I am using wordpress site. I created menu bar, inside of sub-menu, used position:fixed
element. Anybody tell me how can i disable mousewheel inside of that sub-menu. That means i don’t want page scroll inside of that sub-menu.
Please anyone help me.
You can use CSS property
overflow: hidden;
which specifies what happens if content overflows an element’s box.Using
overflow: hidden;
allow you to do not show up the scroll bar and so do not allowing scrolling at all including mouse weal.Here below a very generic example, please consider to add your real markup in your question for a fix on your real app code.
https://jsfiddle.net/bxohL8tt/2/
If the element that is scrolling on mouse-wheel event is the body, or even some other element, you can use JavaScript to prevent it from scrolling while your menu has “focus” like this:
Add the above inside a
<script>
element at the end of your main HTML source-code and it should work.You can do this by the following code:
For example: (The example shows the disabling on the menu but it’s just the same)