Skip to main content

Bug Tracker

Side navigation

#3183 closed bug (wontfix)

Opened July 24, 2008 09:46AM UTC

Closed July 25, 2008 12:07AM UTC

Bind an event of type "mouseenter" or "mouseleave" on map area

Reported by: slayne Owned by:
Priority: major Milestone: 1.3
Component: event Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:


If I do execute this code on IE, he doesn't work :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" xml:lang="fr" lang="fr">
  <script type="text/javascript" src=""></script>
  <script type="text/javascript">
    jQuery("#myArea").bind("mouseenter", function(){ alert("mouse enter"); });
    jQuery("#myArea").bind("mouseover", function(){ alert("mouse over"); });
  <img src="" border="0" usemap="#myMap" />
  <map name="myMap">
   <area id="myArea" shape="poly" coords="221,360,511,372,594,292,467,70,285,6,67,26,3,121" href="" alt="" />

I think that there is a bug in the browser, it do not fire events "onmouseenter" and "onmouseleave" on AREA element.

I have add this code line in jQuery.js at row number 2226 :

bind: function( type, data, fn ) {
 return type == "unload" ?, data, fn) : this.each(function(){
  if (jQuery.browser.msie && this.nodeName.toLowerCase() == "area")
   type = type.replace(/mouseenter/, "mouseover").replace(/mouseleave/, "mouseout");
  jQuery.event.add( this, type, fn || data, fn && data );

And I want your opinion on this bug.

Thanks a lot ;-)

Attachments (0)
Change History (1)

Changed July 25, 2008 12:07AM UTC by flesler comment:1

resolution: → wontfix
status: newclosed

mouseenter and mouseover are different kind of events.

mouse(over|out) are real events. mouse(enter|leave) are custom events.

If IE doesn't trigger those events, just bind to the map, and check to see if it was an area.

area elements are barely used, and this is the first time I see this reported, so I think there's no sense in adding so many bytes of code for this.