使用cbpFWSlider自动播放JQuery幻灯片 [英] Autoplay JQuery slideshow Using cbpFWSlider
本文介绍了使用cbpFWSlider自动播放JQuery幻灯片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用cbpFWSlider,它似乎不包含自动播放选项.我对Jquery还是很陌生,并且已经Google登高了,但还没有找到解决方案.这可以添加吗?开源脚本在这里: http://tympanus.net/codrops/2013/02/26/full-width-image-slider/
I'm using cbpFWSlider and it doesn't appear to include an option for autoplay. I'm pretty new to Jquery and have Googled to high heaven but have yet to find a solution. is this something that can be added? The open source script is here: http://tympanus.net/codrops/2013/02/26/full-width-image-slider/
推荐答案
您可以在右侧(或左侧)按钮中设置点击事件
you can set the click event in right (or left) button
$('document').ready(function(){
// init slider
$('#cbp-fwslider').cbpFWSlider();
/**
Set a 3 seconds interval
if next button is visible (so is not the last slide) click next button
else it finds first dot and click it to start from the 1st slide
**/
setInterval( function(){
if($('.cbp-fwnext').is(":visible"))
{
$('.cbp-fwnext').click();
}
else{
$('.cbp-fwdots').find('span').click();
}
} ,3000 );
});
这篇关于使用cbpFWSlider自动播放JQuery幻灯片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文