I have this small script that shows a caption for a img when it is moused over.
$("#v1").mouseover(function()
{
$("#vc1").fadeIn("slow");
});
How can I expand on this so that the caption #vc1 fades back out when the icon #v1 is not moused over?
Might consider using hover, which is essentially
mouseenterandmouseleaveThe difference is that
mouseoverandmouseoutwill fire when you move into a child element of the element to which the event handler is attached, whereasmouseenterandmouseleavea.k.a.hoverwon’t. This may not be a problem if the element to which you’re attaching doesn’t have children.