Is there a way to temporarily disable the event listener?
In my case, I have a third-party library ( not jQuery centric) that fires mouseover / mouseout events for an element using addEventListener / attachEvent .
Under certain circumstances, another event fires on a different element, and I need to disable these event listeners. My solution so far has been just unbind
mouseover / mouseout. This is usually normal, because this event usually causes a page refresh.
However, an error occurs from time to time (I think a validation error), which causes the page to not refresh, and I need to re-attach mouse / mouse event listeners.
Helpful information
It might be worth mentioning that since mouseover / mouseout event listeners are created and attached in a third-party library, I cannot just assign the event to a variable and bind / untie it in such a way (that AFIK is the best way to do this).
Update
I originally asked
Is there a way in jQuery to get event listeners already assigned to an object?
Since then, I found out that it is not possible to access events assigned by addEventListener / attachEvent: Access events added using attachEvent () / addEventListener () in JavaScript
source