Let’s say you have a <div> element which is hidden.
There is a mouseover event attached to it and the mouse cursor is placed at the location where the <div> element will appear once it is visible.
How I can prevent the mouseover event from firing when the <div> is made visible?
You can’t. The event is fired when the mouse is over a new element in Gecko, whether due to the mouse moving or elements moving. This is quite purposeful; it makes things like CSS
:hoverwork correctly when the mouse is not moving.