161
rated 0 times
[
164]
[
3]
/ answers: 1 / hits: 16771
/ 8 Years ago, fri, march 11, 2016, 12:00:00
I would like disable vertical scroll in all mobile devices and i found this:
document.body.addEventListener('touchmove', function(e){ e.preventDefault(); });
that works very well...
but in this way i disable scroll also for a div (my menu) that has overflow: auto
.
In dekstop browser to avoid anything with JQuery when $(window).scroll()
add overflow: hidden
to body
. And in that way i don't have problem, but with native javascript code yes... i'm new in javascript.
So with jquery i was able disable scroll of body eccept div with overflow: auto, but not with that js code.
I hope you can help me and sorry for my english.
More From » jquery