javascript - fullpage.js how to detect vertical scrolling -


i building page few "stages" fullpage.js plugin provides.

my main problem need apply fixed position header, default using simple script use of cases far. , here is:

$(document).scroll(function () {   var = $(this).scrolltop()   if (a > 5) { $('header').addclass('headersnap')   } else {     $('header').removeclass('headersnap')   } }); 

i calculate viewport offset ammount , tell append class header using fixed position. here problem fullpage.js not allow simple script detect offset, therefore class not being applied.

what can bypass issue?

managed sort out myself, added scrollbar settings follows:

$(document).ready(function() {     $('#fullpage').fullpage({       scrollbar: true,     }); }); 

this way script works, since has scollbar follow.

note: answers specific question, not overall solution fixed headers. please re-read first post further information on this.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

filehandler - java open files not cleaned, even when the process is killed -

gridview - Yii2 DataPorivider $totalSum for a column -