views:

54

answers:

3

At the moment I have an image, and when the user puts their mouse over it, using Jquery I place a transparent div over the image. The problem is that this triggers the mouseout event. I want the transparent div to leave when the mouse moves away from the image. What is the best way to detect this if there is a transparent div covering the image. Hope that made at least some sense.

+1  A: 

Assuming the div is the same size as the image, you could hide the div on the div's own mouseout event.

Greg
Thanks, can't believe that after half an hour of head scratching that never crossed my mind, it's so simple. Thanks a lot
Lobe
I'm glad it was that simple!
Greg
A: 

There are some plugins available to do this trick (captions on mouse-over) like:

http://buildinternet.com/2009/03/sliding-boxes-and-captions-with-jquery/

http://www.chazzuka.com/blog/?p=138

TheVillageIdiot
Those are some slick ways to show captions!
Greg
+1  A: 

add the mouseOut listener to the div instead.

Marius