richardscarrott / jquery-ui-carousel

jQuery RS Carousel is a responsive and touch-enabled carousel written on top of jQuery and the jQuery UI Widget Factory providing a full and familiar API in less than 2.6kB minified and gzipped.
http://richardscarrott.github.io/jquery-ui-carousel/
192 stars 56 forks source link

How to set pause to longer pause for auto scroll? #47

Closed sampahbau closed 11 years ago

sampahbau commented 11 years ago

hi, how do I set pause to longer pause for auto scroll? Where should I type the "pause" command? Thank you.

richardscarrott commented 11 years ago

Hi there,

You can pass in the pause option when instantiating the widget, so for example the following would set the pause option to 20 seconds:

$('.my-carousel').carousel({
    pause: 20000
});

And after instantiation you can update the pause by calling:

$('.my-carousel').carousel('option', 'pause', 10000);

Hope this helps.

sampahbau commented 11 years ago

Hi, I download your Java Script and I am not sure if I can find $('.my-carousel') anywhere in your Javascrip, also I'm not sure where the carousel initiated, this is the java script code below, Thanks for the reply.

richardscarrott commented 11 years ago

The demo code you posted above might be a little confusing to be honest as it handles the dynamic option updates from the form inputs so you would be better off following the docs - https://github.com/richardscarrott/jquery-ui-carousel#readme

$('.my-carousel') was meant as an example for your carousel element, you can read more about the jQuery factory function here - http://api.jquery.com/jQuery/