Using the jQuery Cycle plugin, the following code allows user to browse the photos/:
$('#slideShow').cycle({
fx: 'shuffle',
shuffle: {
top: -230,
left: 230
},
speed: 300,
next开发者_C百科: '#slideShow',
timeout: 0
});
Can anyone suggest if there is a way to keep track which image is being shown at the moment?
Let's say, there are 5 images, I want to be able to show caption of each picture. So, I have to know which image is being clicked in order to show the correct caption.
Just use the after
event.
after: function() {
// this contains the current image
// $(this) makes a jQuery object
}
Following link shows the example of caption used for fancybox:
http://jquery.malsup.com/cycle/caption.html
精彩评论