tvgemert
tvgemert

Reputation: 1486

jQuery cycle how to resume a paused cycle when clicking on pager

I have a jquery cycle running with a pager. It automatically cycles, and it has pager buttons to manually control the cycle, after using the pager buttons it resumes automatic advance. Now I also built an external button to pause the cycle. But after the cycle is paused using this button I want it to resume cycling when a pager button is clicked... but that is what it doesn't do.

Tips or tricks anyone?

Upvotes: 0

Views: 590

Answers (1)

lucuma
lucuma

Reputation: 18339

You need to wire an event to your pager to resume the cycle:

$('#pager li').click(function() {
    $('#slideshow').cycle('resume');
});​

Here is a full example:

http://jsfiddle.net/lucuma/fg6d4/2/

Update per comment:

Alternatively you could bind on mouseleave and click and it should fix the hover issue too:

$('#pager li').on("mouseleave click",function() {
    $('#slideshow').cycle('resume');
});​

Upvotes: 2

Related Questions