My jQuery disappears here: http://dougie.thewestharbour.com/
When you get the upper hand over div.main-overlay, I would like it to go out, and then when you separate it from the mouse, I would like it to disappear again.
However, now you can see how it flickers. I guess this is because the div disappears, so it is perceived as a mouse when it disappears, but I'm not sure how to solve it.
Here is my javascript:
$(document).ready(function () { $('.main-overlay').hover( //Mouseover, fadeIn the hidden hover class function() { $(this).fadeOut('1000'); }, //Mouseout, fadeOut the hover class function() { $(this).fadeIn('1000'); }).click (function () { //Add selected class if user clicked on it $(this).addClass('selected'); }); });
And here is one of the elements that the overlay div is attached to:
<li><div class="main-overlay"></div><span class="caption">The store front</span><img src="http://dougie.thewestharbour.com/wp-content/uploads/store-front.jpg" alt="store front" title="store-front" width="730" height="360" class="alignnone size-full wp-image-98" /></li>
Thanks,
Wade
source share