jquery-ui-carousel icon indicating copy to clipboard operation
jquery-ui-carousel copied to clipboard

Pause button

Open ac-bristol opened this issue 9 years ago • 1 comments

Hi there, I'm looking at adding a pause button for the carousel. After extensive UX testing on a site using the carousel, it was determined that a pause button should be present to allow users to stop the auto rotate. Is this functionality already available?

Cheers

ac-bristol avatar Jul 09 '14 10:07 ac-bristol

Yes and no.

The autoscroll extension has two methods, _stop and _start however they're both private. They're used internally to stop and start the autoscrolling when you hover over the carousel.

I've never had the need to stop the autoscroll but I get it could be useful so I could potentially make them public.

For now however you could call them directly on the instance:

var carousel = $(':rs-carousel').data('carousel');
carousel._stop();
carousel._start();

There's not currently any internal state to maintain whether the carousel is autoscrolling or not so you'd have to maintain that yourself for now.

Feel free to send a pull request and I'll merge it in if you do it otherwise I'll add it in when I get a chance.

richardscarrott avatar Jul 09 '14 18:07 richardscarrott