Skip to content

Instantly share code, notes, and snippets.

@bob-moore
Created March 25, 2016 15:53
Show Gist options
  • Save bob-moore/5c1198b055a78458987e to your computer and use it in GitHub Desktop.
Save bob-moore/5c1198b055a78458987e to your computer and use it in GitHub Desktop.
Basic Waypoint Usage
// 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