jQuery(window).scrollTop() issue in Firefox? -
i have following code use display hidden footer when scroll down past point on page.
jquery(document).scroll(function(){ if(jquery(window).scrolltop() >= jquery('.foot').offset().top + jquery('.foot').height() - window.innerheight) { // add class here } else { // remove class here });
this works fine in chrome , ie. doesn't work in firefox. i've narrowed problem down jquery(window).scrolltop(). i've created test http://jsfiddle.net/captainmorgan/cvsre/1/ open in chrome , scroll down mouse wheel. 100. when same thing in firefox 114, firefox continues display multiple messageboxes , number keeps decreasing. know why firefox this?
try:
jquery(window).scroll(function(event) { var nextscroll = jquery(this).scrolltop(); if(nextscroll > (jquery('.foot').offset().top + jquery('.foot').height() - window.innerheight)) { //action } });
Comments
Post a Comment