javascript - jQuery - Stop listening for scroll down -


so using code perform tasks when user scrolls:

function myfunction(){ var position = $(window).scrolltop();  $(window).scroll(function() {     var scroll = $(window).scrolltop();     if(scroll > position) {          // scrolling downwards          hypedocument.showscenenamed('section 2', hypedocument.kscenetransitioncrossfade, 1.1);     }     position = scroll; });  return false; } 

but prevent down scrolling on 1 page. there anyway can whilst allowing scroll on other pages? tried using $(window).off("scroll"); blocks scrolling in both directions.

this disable scrolling:

$('html, body').css({     'overflow': 'hidden',     'height': '100%' }); 

to restore:

$('html, body').css({     'overflow': 'auto',     'height': 'auto' }); 

Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -