Disable scrolling events in jQuery

Is it possible to prevent a scroll event in jQuery?

I tried this code but it did not work.

$('*').scroll(function(event){ event.stopPropagation(); event.preventDefault(); return false; }) 
+4
source share
3 answers

ok .. i was working with the wrong event. touchmove was exactly what I was looking for. So

 $('body').bind('touchmove', function(e){ e.preventDefault(); }); 
0
source

You can disable scrolling in certain areas of an element using the following:

 $("element,element2").bind("touchmove",function(e){ e.preventDefault(); }); 
+3
source

Just set body CSS to disable scrolling.

 body { overflow: hidden; } 
+2
source

All Articles