fancybox - Simple jQuery show(); hide(); confusion -



fancybox - Simple jQuery show(); hide(); confusion -

i have jquery code:

<script type="text/javascript"> $(function() { $(".one-edition img").hover(function() { $(this).next(".editions-info-text").show(); }, function() { $(this).next(".editions-info-text").hide(); }); }); </script>

which, if image under div one-edition hover'd on shows info text div, , when hovered out, disappears - easy.

however, i'm trying work using fancybox gallery so:

<div class="grid_3 one-edition"> <a href="images/latest/mo20.jpg" rel="editions-1"><img src="http://placehold.it/200x250"></a> <a href="images/latest/mo20.jpg" rel="editions-1"></a> <a href="images/latest/mo20.jpg" rel="editions-1"></a> <div class="editions-info-text"> <p>title of edition</p> <p>further information</p> </div> </div>

the gallery works fine, editions-info-text no longer showing or hiding. must wrapping img in anchor tag, i've been trying mess around while , felt guys might able help.

i think problem comes $(this).next(".editions-info-text").show();. $(this) should image element, next() means find image's siblings, .editions-info-text not in siblings. need rewrite selector query little bit.

jquery fancybox show-hide

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -