mouseenter/mouseleave

Wednesday, May 27, 2009
By keiji
Category: Javascript, jQuery, Tips
Recently, I encountered an issue regarding "mouseenter/mouseleave" events.
Those events are supported by only IE, but non by non-IE browsers.

There are similar events "mouseover/mouseout" supported by most browser.

Essentially, "mouseenter/mouseleave" won't be triggered by child elements, whereas "mouseover/mouseout" will.
You can google "mouseenter/mouseleave", and find many article about that.

The difference is fundamental and we can't use those events for the purpose of "mouseenter/mouseleave".

Fortunately, jQuery provide special function .hover()
By using that, you can easily implement the "mouseenter/mouseleave" callback function.

Comments

N/A

Reply to

Subject:
Name:
E-Mail:
Comment:
(Max 1000 chars)
Confirmation Key:
Please enter the value displayed in the image.
Send Send