sliderInstance.startAutoPlay();

fuel's Avatar

fuel

27 Sep, 2012 11:30 PM

I have a slider with I want to autostart after 5000 milliseconds. I have the following configuration:

var royal = $('#homeslider').royalSlider({
    ..... other options .....
    autoPlay: {
        enabled: false,
        pauseOnHover: false,
        stopAtAction: false,
        delay: 3000
    }
}).data('royalSlider');

setTimeout(function(){
    royal.startAutoPlay();
}, 5000)

It does start to play after 5000ms but it only goes to the second slide and stops playing. Am I missing something?

  1. Support Staff 1 Posted by Dmitry Semenov on 28 Sep, 2012 06:34 AM

    Dmitry Semenov's Avatar

    Hi,

    If you set enabled:false for autoPlay module it just will not bind any events that listen for slide change e.t.c. So when you call startAutoPlay it just runs it once.

    To make it work it should look like this:

    var royal = $('#homeslider').royalSlider({
        ..... other options .....
        autoPlay: {
            enabled: true,
            pauseOnHover: false,
            stopAtAction: false,
            delay: 3000
        }
    }).data('royalSlider');
    
    royal.stopAutoPlay();
    setTimeout(function(){
        royal.startAutoPlay();
    }, 5000)
    

    There is even more simply approach, you may add data-rsDelay="8000" attribute to root node of first slide and it'll work like you want without any additional JS.
    http://dimsemenov.com/plugins/royal-slider/documentation/#autoplay

    Dmitry

  2. 2 Posted by fuel on 02 Oct, 2012 11:35 AM

    fuel's Avatar

    Hey Dimitry, many thanks, this made things clear to me.

  3. 3 Posted by mohit puri on 09 Oct, 2012 04:32 PM

    mohit puri's Avatar

    i want to stop autoplay on click function ....plz give me suggestion how to do that...thanx

  4. Support Staff 4 Posted by Dmitry Semenov on 10 Oct, 2012 06:35 AM

    Dmitry Semenov's Avatar

    $('#button').click(function() { $('.royalSlider').royalSlider('stopAutoPlay'); } );.

    Dmitry

  5. 5 Posted by mohit puri on 17 Oct, 2012 01:51 PM

    mohit  puri's Avatar

    is there any option to show two images on screen,
    i used multiple gallery slider i show two images by using margin zero
    but on full screen only one image show.....is there any solution to show two images also on full screen
    thanks

  6. Support Staff 6 Posted by Dmitry Semenov on 18 Oct, 2012 07:15 AM

    Dmitry Semenov's Avatar

    There is no custom option for this, you'll need to modify CSS of fullscreen slider.

    Dmitry

  7. 7 Posted by mohit puri on 18 Oct, 2012 07:20 AM

    mohit puri 's Avatar

    i want to show two images ...can u give me a styles of two images show
    a vary Thanks for previous answer

  8. Support Staff 8 Posted by Dmitry Semenov on 18 Oct, 2012 07:31 AM

    Dmitry Semenov's Avatar

    If you send me link to page you're working on, I'll take a look if I can help you.

    Dmitry

  9. 9 Posted by fuel on 21 Oct, 2012 11:24 AM

    fuel's Avatar

    Dmitry, thanks for your help. I have it all sorted out and works perfectly.

  10. fuel closed this discussion on 21 Oct, 2012 11:24 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac