jQuery Cycle2每张幻灯片速度选项

时间:2016-01-11 16:01:37

标签: jquery-cycle2 cycle2

我可以使用timeoutFn更改超时。如何为速度做同样的事情?我没有找到任何其他在幻灯片元素上具有data-speed属性的方法。有没有办法以编程方式改变它?

$('.slideshow').cycle({
                speed: 100,
                timeoutFn: calculateTimeout,
                slides: "li",
                fx: 'scrollLeft,scrollDown,scrollRight'
});

function calculateTimeout(currElement, nextElement, opts, isForward) { 
        var currentElementTransition = $(currElement).attr('data-timeout');
        return parseInt(currentElementTransition, 10) || 0; 
} 

0 个答案:

没有答案
相关问题