I would use the title
attribute as a caption in a gallery. The caption will be in a fixed
position on the page. I can't update dynamically the content of the title
attribute in the div
showing various caption one at a time.
html markup
<!-- fist slide -->
<div class="section" id="gallery-start">
<div class="content">
<img src="img/1.jpg" title="Caption text 1">
</div>
</div>
...
<!-- caption -->
<div class="caption-display"></div>
js script
$('.caption-display').each(function(i) {
$(this).html($('.gallery-element').eq(i).attr('title'));
});
example