Using jQuery/Javascript, how can I check which was the first element that the mouse hovered after a MouseLeave event?
Basically, I want to check from an array of elements if the mouse is rolling over those elements or not.
I’m trying to use the event.relatedTarget.
Any help?
There exists a
relatedTargetproperty on the mouse eventsand for the
mouseleaveit points to the element that was entered.So you could just do
demo at http://jsfiddle.net/gaby/V4pJb/