I’m tweaking a gallery plugin for a site that I’m working on, so that it will support titles. This is this script I’m working with:
DEMO: http://jquery.malsup.com/cycle/pager2.html
CODE: http://malsup.github.com/jquery.cycle.all.js
I have everything working, except I need the alt attribute from the original image to be copied to the thumbnails on load, but I can’t figure out where things are getting restructured in this script.
This is the modification that I’m using:
$(document).ready(function() {
$("#slideshow-wrap #nav li a img").click(function() {
var caption = $(this).attr("alt");
$("#slideshow-wrap #caption").html(caption);
});
});
(The above code works, I just need to copy the ALT attribute from the original <img> to the jQuery-generated <img> thumbnail.)
If I understand correctly what you need, the changes you have to make to the example given on the page are minimal: