jqueryanythingslider

Anything slider to go back to first slide after initial loop


like the title says, I'd like to go back to the first slide after looping through 4 slides.

I went through the options in jquery.anythingslider.js, but I couldn't figure how to implement this functionality.

Any help is greatly appreciated.


Solution

  • I'm not sure if this is exactly what you're asking for, but check out the FAQ page, listed under "How do I get the slider to play through my slides, then return to the first one and stop?", basically it needs this initialization code:

    $('#slider').anythingSlider({
      stopAtEnd  : true,  // If true & the slideshow is active, the slideshow will stop on the last page.
      onShowStop : function(e, slider){
        setTimeout(function(){
          // only go to the first page if the last page is visible
          if (slider.currentPage === slider.pages) { slider.gotoPage(1); }
        }, slider.options.delay);
      }
    });
    

    Please note: this code will always return the slider to the first panel, when on the last panel and the slide show stops.