jQuery Cycle2 per-slide speed option

旧城冷巷雨未停 提交于 2019-12-13 19:25:03

问题


I can change timeout using the timeoutFn. How can I do the same for speed? I seached and could not find any way other that having the data-speed attribute on the slide elements. Is there any way to change that programmatically?

$('.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; 
} 

来源:https://stackoverflow.com/questions/34725917/jquery-cycle2-per-slide-speed-option

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