How to Add Auto-Rotation to a jQuery Horizontal Accordion

纵然是瞬间 提交于 2019-12-02 08:40:06

First - I don't feel the way You use prev().trigger('something') I'm not sure what it's for. It looks like it populates the event to other elements. I don't get it ;)

As for the question: You should do something like this:

setInterval(function(){
 $next=$('.active').next('.slide');
 if($next.length==0){ $next=$('.slide:first'); }
 $next.find('.slidebutton').triggerHandler('click');
},3000);

You might need to change some classes etc.

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