jQuery Cycle Plugin Caption Issue
I have the following test code:
- <div class="pics">
<p width="191";>These are the colors available. Click on a picture to see more information</p>
<a href="A"><img src="images/black.jpg" width="191" height="143" alt="Black" /></a>
<a href="B"><img src="images/blue.jpg" width="191" height="143" alt="Blue" /></a>
<a href="C"><img src="images/pink.jpg" width="191" height="143" alt="Pink" /></a>
</div>
<p id="caption"></p>
<script type="text/javascript">
$('.pics').cycle({
fx: 'fade',
timeout: 2000,
speed: 300,
pause: '1',
after: function() {
var alt = $('img',this).attr('alt');
$('#caption').html(alt);
}
});
</script>
which has a plain text message followed by 3 pictures (all links), and works great. Except the pictures have a caption underneath, but I want the caption to go away when the plain text message is displayed again. I've been searching for several hours for an answer and tried various ways to code for the "alt = $('img',this).attr('alt'):" not returning a value, but nothing I've tried has worked. The caption from the last image still displays while the text message is displaying. Any help would be gratefully received!