I have this code:
$("document").ready( function () {
$(".userPic").mouseover(function () {
$(".changePic img").css("display", "block");
})
$(".userPic").mouseout(function () {
$(".changePic img").css("display", "none");
})
})
I have 2 DIVs and 1 image inside each them.
My problem is when you mouseover .changePic (which is inside .userPic) the mouseout event will fire and the image will not be displayed.
How I can apply the mouseover to all elements inside the main DIV .userPic? So when you mouseover the images and .changePic, the image will still be displayed and the mouseout event will not fire.
How can it be done?
HTML code:
<div class="accountPic">
<div class="userPic">
<img src="images/userPhoto.png" alt="" width="236" height="200" />
</div>
<div class="changePic"><a href="editUsers.php"><img style="display: none;" src="images/config.png" alt="" width="13" height="14" border="0" /></a></div>
</div>