开发者

jQuery Cycle - to keep track of what element is being shown

开发者 https://www.devze.com 2023-03-29 11:30 出处:网络
Using the jQuery Cycle plugin, the following code allows user to browse the photos/: $(\'#slideShow\').cycle({

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

0

精彩评论

暂无评论...
验证码 换一张
取 消