0

I have a website where I'm utilizing flex Slider. I have a navigation where the user can jump to slides.

It is a continuous carousel slide show. Right now I have slideshowSpeed set to 6000 milliseconds.

The problem is this: when the user jumps to a new slide, the slideshowSpeed is not reset.
For instance: we're on slide one, 2000 milliseconds elapse and the user clicks to slide 3. Now there are only 4000 milliseconds remaining on slide 3. I would like to reset the timer to begin the 6000 millisecond count again.

Anyone have a good idea on how to do this? maybe it isn't possible?

4

1 回答 1

0

我有一个问题,客户可以在继续之前确定每张幻灯片出现多长时间。我发现更改 slider.slideshowSpeed 确实会更改滑块中的 slideshowSpeed 属性,但不会产生任何影响。

在查看 flexSlider 代码的非最小版本时,我发现您在初始化滑块时设置的所有属性都放入了一个名为 vars 的对象中,因此要更改暂停滑块所需的时间,请将 vars 属性更改为slideshowSpeed 然后恢复滑块:

//暂停滑块

.slider.pause();

//更改滑块中的任何变量

slider.vars.slideshowSpeed = parseInt(slider.slides.eq(slider.currentSlide).attr("intermission")) * 1000;

//重新启动滑块

滑块.resume();

其中 slider.resume() 再次初始化动画。

在上面的示例中,我在 li 上有一个名为“intermission”的属性,其中有一个数字,用于确定幻灯片的新速度 x1000,因此它以 ms 为单位。

关于您的问题,我猜如果您暂停滑块然后再次恢复,滑块计时应该重置。

滑块.暂停();

滑块.resume();

试一试 - 我希望它对你有用。

也许某些属性 Getters 和 Setters 在 FlexSlider 中会很有用,但我想当有可用的解决方法(即使未记录)时,没有它们可以将文件大小保持在最低限度。

干杯,乔纳森

于 2012-05-02T22:00:39.710 回答