Simple modal no scroll background <body>
I use simple modal . Is there a way to keep the background (overlay) from scrolling when you roll the mouse wheel while outside the borders of the modal?
Thanks!
+4
2 answers
I think you can do this:
$(document).on('mousewheel', '.simplemodal-overlay, .simplemodal-data', function(event) { event.preventDefault(); }); I'm not sure mousewheel has full cross-browser support.
Edit: I checked this, but you need the mousewheel plugin: https://github.com/brandonaaron/jquery-mousewheel/downloads p>
Example: http://jsfiddle.net/jtbowden/AhpLc/
(I inserted jquery.mousewheel.min.js into the script scope ... Don't do this)
+1