如何让jQuery中的效果无限制,并且不会停止,因为当我现在运行它时,它只能工作几秒钟(3秒)&在那之后停下来。
例如:
$('div').effect('Slide');
答案 0 :(得分:3)
(function looper(){
// use callback function of the effect to call the outer looper function recursively.
$('div').effect('Slide', function(){
setTimeout(looper, 25); // add a timeout of needed
});
})();
答案 1 :(得分:1)
setInterval(function(){$('div').effect('slide')}, 1000);