I use this code in other projects and it works fine. I don't know what is wrong in my code. It works fine in Chrome but not in Firefox.
This is my code:
$('body').on({
'mousewheel': function(e) {
e.preventDefault();
e.stopPropagation();
}
});
body {
height: 5000px;
}
<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
Example jsFiddle.
The jQuery version in my project is 1.11.3.
Some browsers have there default "scroll-overflow" not on the body. Instand it is on html or document. Try $('html') or $(document) for example. That could help
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