View Full Version : Resolved JS try to use hover on map areas

11-01-2011, 11:26 PM
Hello everybody,

I've tried to use the jQuery .hover() for html map areas. Basically it works, but not correct: during the time the mouse is over an element, the onmouseover-picture appears and disappears on each mouse move. I can't figure it out, why it doesn't work as expected..., e.g. stay there and stop disappearing on mouse move?!

I've also tried to replace the .hover() by .mouseenter() followed by .mouseleave() but with same result. And at least, I've removed the .mouseleave() event with the hope, I could just let the script show the first picture and then the second. Unfortunately, the script stops after showing one picture.

If you just could take a look here: http://x-mediapro.de/testing/sofiamap/trymap.html

Thanks in advance!!

OK, I was too quickly to ask, and think after... The html map object is always connected to an image. If my script shows a second image over the first one, the mouse is no more over the map, because the second image fits just between the mapped one and the mouse pointer. That's why the script considers, that the mouse should be out and executes the part for mouseleave. Which removes the second image and the mouse is over the first mapped image again. This is recognized by the script again, and the mouseover event is called again, and so long...