I'm trying to display photo captions on a gallery on mouseover
, then on mouseout
it hides the caption.
Here's the html:
<ul class="gallerylist">
<li class="galleryitem">
<a href="https://www.google.com"><img class="videothumb" src="https://www.google.com/images/srpr/logo11w.png"></a>
<br />
<div id="thumb-rollover">Rollover caption 1
</div>
</li>
<li class="galleryitem">
<a href="https://www.google.com"><img class="videothumb" src="https://www.google.com/images/srpr/logo11w.png"></a>
<br />
<div id="thumb-rollover">Rollover caption 2
</div>
</li>
<li class="galleryitem">
<a href="https://www.google.com"><img class="videothumb" src="https://www.google.com/images/srpr/logo11w.png"></a>
<br />
<div id="thumb-rollover">Rollover caption 3
</div>
</li>
</ul>
id thumbnail-roller
is hidden by default
I started with the following jquery but not sure if this is the right approach.. should I use hover
?? Right now it only displays the caption for the first item instead of the one that I mouseover
. Any help is appreciated.
$("li.galleryitem").mouseover(function() {
$("#thumb-rollover").css('visibility', 'visible');
});
Here's the jsfiddle sample: http://jsfiddle.net/gjxubcru/