Flexslider - different slideshow animation on each slide

泄露秘密 提交于 2019-12-11 23:10:54

问题


I am now using this code to change the speed on each slide, but I also need to change the slide animation for some slides. Any ideas how to do this in a similar or any other way?

    $(window).load(function() {        
$('.flexslider').flexslider({
    animation: "slide",
    controlNav: false,
    directionNav: false,           
    pausePlay: true,
    animationSpeed: 300,
    start: function(slider) {
        clearInterval(slider.animatedSlides);
        slider.animatedSlides = setInterval(slider.animateSlides, YOUR_TIMEOUT_FOR_FIRST_SLIDE(ONLY FOR START));                
    },
    after: function(slider){
        if(slider.currentSlide == 0) {
           clearInterval(slider.animatedSlides); 
           slider.animatedSlides = setInterval(slider.animateSlides, FIRST_TIMEOUT);
        }
        if(slider.currentSlide == 1) {
           clearInterval(slider.animatedSlides); 
           slider.animatedSlides = setInterval(slider.animateSlides, SECOND_TIMEOUT);
        }
        if(slider.currentSlide == 2) {
           clearInterval(slider.animatedSlides); 
           slider.animatedSlides = setInterval(slider.animateSlides, THIRD_TIMEOUT);
        }
    }          
});

来源:https://stackoverflow.com/questions/18685300/flexslider-different-slideshow-animation-on-each-slide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!