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

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

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