1

I'm using Mike Alsup's awesome Cycle2 jquery plugin on a slideshow that features both a custom pager element (thumbnails) and previous/next buttons. How can I trigger an action using the cycle-after event only if the pager was clicked.

$('#myslideshow').on('cycle-after',function(e, optionHash, outgoingSlideEl, incomingSlideEl, forwardFlag){
    // Do something here only if the pager was clicked.
});

I don't want to use the click event from the pager element - that won't wait until the slide transition is complete, it fires right away, and seems to conflict with the slideshow animations sometimes.

4

1 回答 1

2

How about setting a boolean value to true during the click event of your pager item or the cycle-pager-activated event, and using that value inside the cycle-after event, then reset it back to false.

于 2014-02-27T21:42:39.977 回答