Created
March 25, 2016 15:53
-
-
Save bob-moore/5c1198b055a78458987e to your computer and use it in GitHub Desktop.
Basic Waypoint Usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Document ready function | |
jQuery( document ).ready(function($) { | |
'use strict'; | |
// Define our elements so we can cache them | |
var $masthead = $( '$masthead' ); | |
var $body = $( 'body' ); | |
// Use waypoints | |
$body.waypoint( function( direction ) { | |
if( direction === 'down' ) { | |
//do stuff you want to happen on down | |
} else { | |
// do stuff you want to happen on up | |
} | |
}, { | |
// Define where we want waypoint to fire | |
offset : '-300px', | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment