Jquery $(window) pass option with { passive: false }

i am getting following error:

Unable to preventDefault inside passive event listener due to target being treated as passive

from this code:

$(window).on("DOMMouseScroll mousewheel wheel", _methods._handler_window_mousewheel);

from what i was able to find, it seems that solution should be adding { passive: false } as options, but i am stuck on that, since i dont know how to do that :/
Basically like this:

document.addEventListener('touchstart', handler, {passive: false});

but when i do this:

 $(window).on("DOMMouseScroll mousewheel wheel", _methods._handler_window_mousewheel, { passive: false});

I get this error:

TypeError: ((w.event.special[a.origType] || {}).handle || a.handler).apply is not a function

My Jquery knowledge is pretty limited, so thats where i hit wall. Thanks for any help.

56 thoughts on “Jquery $(window) pass option with { passive: false }”

Leave a Comment