Flexslider-动画:"slide",animationLoop:"true" - 冲突 [英] Flexslider - animation: "slide", animationLoop: "true" - Conflict

查看:259
本文介绍了Flexslider-动画:"slide",animationLoop:"true" - 冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些特定情况下, Flexslider 2 出现问题.我将其用作内容滑块.我需要的是动画SLIDE,而不是淡入淡出,然后循环播放幻灯片.我有3张包含div内容的幻灯片,并且其中包含更多列表,以显示画廊类型的设置.我遇到的问题是,当我设置所需的选项时,滑块会先显示最后一张幻灯片,然后再滑动到幻灯片2,然后依次显示3,然后1.它不会将第一张幻灯片显示为第一张幻灯片. startAt参数无效.

I have an issue with Flexslider 2 under some specific circumstances. I'm using it as a content slider. What I need is to have the animation SLIDE rather than fade, and loop the slides. I have 3 slides with div content and more lists inside them to show a gallery type setup. The issue I'm running into is that when I set the options I need, the slider shows the last slide first, then slides on to slide 2, then 3, then 1. It won't show the first slide as the first slide. The startAt parameter has no effect.

当我将滑块设置为使用以下各项时,一切都完美运行:

Everything works perfectly when I set the slider to use the following:

$(".flexslider").flexslider({
    animation: "slide",
    animationLoop: false
});

如果我将其设置为:

$(".flexslider").flexslider({
    animation: "fade",
    animationLoop: true
});

但是,如果我将动画设置为幻灯片,然后将其循环设置为true,它将再次显示最后一张幻灯片,并且不会以正确的顺序显示幻灯片.有什么我可以做的吗?似乎是动画幻灯片和循环之间的冲突.

But if I set animation to slide, and loop to true, it shows the last slide first again and won't show the slides in the correct order. Is there anything I can do about this? Seems to be a conflict between animation slide and looping.

我需要以下代码才能工作,但不需要:

I need the following code to work, but it doesn't:

$(".flexslider").flexslider({
    animation: "slide",
    animationLoop: true
});

未收到任何控制台错误.有什么想法吗?

Not getting any console errors. Any ideas?

推荐答案

从jquery中删除这些行.

remove these lines from the jquery.

methods.uniqueID(slider.slides.first().clone().addClass('clone') ).appendTo(slide.container); methods.uniqueID( slide.slides.last().clone().addClass('clone')).prependTo( slide.container); }

methods.uniqueID( slider.slides.first().clone().addClass('clone') ).appendTo( slider.container ); methods.uniqueID( slider.slides.last().clone().addClass('clone') ).prependTo( slider.container ); }

这将解决问题.

这篇关于Flexslider-动画:"slide",animationLoop:"true" - 冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆