如何在Carousel Slider中添加自动播放设置(How to add auto play setting in Carousel Slider)
原文:https://stackoverflow.com/questions/29180927
更新时间:2021-06-22 13:06
最满意答案
您使用的插件不提供自动播放功能检查文档
在FIDDLE上检查示例我已经使用RadiantScroller的API和回调函数添加了自动播放设置
<script> $(document).ready(function() { var sc; sc = $('#myScroller').radiantScroller({ elementWidth: 400, cols: 3, rows: 2, loaded : function(){ setTimeout(function(){ sc.radiantScroller('next'); },2000) }, afterMove : function(){ setTimeout(function(){ sc.radiantScroller('next'); },2000) }, lastPageReached : function(){ setTimeout(function(){ sc.radiantScroller(1); },2000) } }); });plugin you used is not provide auto play feature check document here
check example on FIDDLE i have added auto play setting using RadiantScroller's API and callbackfunctions
<script> $(document).ready(function() { var sc; sc = $('#myScroller').radiantScroller({ elementWidth: 400, cols: 3, rows: 2, loaded : function(){ setTimeout(function(){ sc.radiantScroller('next'); },2000) }, afterMove : function(){ setTimeout(function(){ sc.radiantScroller('next'); },2000) }, lastPageReached : function(){ setTimeout(function(){ sc.radiantScroller(1); },2000) } }); });
文章来源:https://www.656463.com/wenda/rhzCarouselSliderztjzdbfsz_322