Maybe you can bind a mouseover event to the map areas, that would do nothing
but return false. This may keep the mouseout from firing when you mouseover
an area --
$("area").mouseover(function() {
return false;
});
----- Original Message -----
From: "Fabien Meghazi" <[EMAIL PROTECTED]>
To: "ML:jQuery" <[email protected]>
Sent: Thursday, September 20, 2007 3:13 PM
Subject: [jQuery] Image + map area + mouseout event
Hi all,
I've got an image with a map area defined for it. Eg:
<img id="myimage" src="img/myimage.gif" width="260" height="219"
border="0" usemap="#myimage_map"/>
<map name="myimage_map" id="myimage_map">
<area href="#" alt="foo" shape="polygon" coords="233, 135, 219, ...">
<area href="#" alt="bar" shape="polygon" coords="13, 125, 319, ...">
...
</map>
I've got a mouseout event binded to the image itself :
$("#myimage").bind("mouseout", function() {
console.log("Hello")
doStuff();
});
My problem is that when the cursor is over an area in the image, the
mousout event of the image is called. (probably because of those event
bubbling/capturing I never understoof how to deal with). I tried
event.stopPropagation() and event.preventDefault() without success.
Is there a way to avoid that behaviour ?
--
Fabien Meghazi
Website: http://www.amigrave.com
Email: [EMAIL PROTECTED]
IM: [EMAIL PROTECTED]