jQuery Waypoints Plugin

webhostfrenzy

New Member
How are you?Im using waypoints plugin for sticky elements as i scroll down the page.However I will like to have the sticky remove at a certain position of the page, lets say 30px from its starting scroll point and then when the user scrolls up back the page, the sticky elements takes it back and up back to its original starting point:JavaScript:\[code\]$(function() { // Do our DOM lookups beforehand var nav_container = $(".nav-container"); var nav = $("nav"); nav_container.waypoint({ handler: function(event, direction) { nav.toggleClass('sticky', direction=='down'); if (direction == 'down') nav_container.css({ 'height':nav.outerHeight() }); else nav_container.css({ 'height':'auto' }); }, offset: 15 });});\[/code\]Another Example you can look at that i found online is herehttp://webdesigntutsplus.s3.amazonaws.com/tuts/313_waypoints/demo/index.htmlLets just say I want the sticky nav to be dropped off at CHAPTER ONE as im scrolling down then when I'm scrolling back up it gets picked up back and carry it to the starting point.Also: http://imakewebthings.com/jquery-waypoints/#doc-disableI was trying to use this but no success.ThanksAny direction from Fiddle will help!
 
Top