문제

나는 슬라이드를 루프로하고 마지막 슬라이드에서 정지하고 마지막으로 슬라이드를 멈추고 싶습니다.

도와주세요.

$(document).ready(function() {
    $('.flexslider').flexslider({slideshowSpeed: 5000});
});
.

도움이 되었습니까?

해결책

Using the callback features you could do something like this.

First set a variable to the number of loops you want:

var n = 4

then when you initialise the slider add this option:

after: function(slider) {
   if (slider.currentSlide == slider.count - 1) { // is last slide
      n--;
      if(n==0) {
        slider.pause();
      }
   }
}

I had hoped to use the end: function(){} feature but this only fires when the animation is disabled. There is a slight annoyance here as the var n will continue to decrement if the users cycle manually. Not too troublesome though I hope.

A nice bonus here is that you can resume the slideshow if you want. Check out the advanced docs for more.

Hope that helps!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top