$('.news-wrap').mouseenter(function(event) {
$(window).mousewheel(function(event) {
event.preventDefault();
});
});
Window scrolling is disabled, each I leave the element. How can I enable scrolling with mouseleave event?
I've written a jQuery plugin to handle this: $.disablescroll.
It stops scrolling from mousewheel, touchmove, and buttons such as Page Down.
$('.news-wrap').mouseenter(function() {
$(window).disablescroll();
}).mouseleave(function() {
$(window).disablescroll("undo");
});
Hope someone finds this helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With