如何使jQuery效果无限?

时间:2012-02-01 08:26:57

标签: javascript jquery jquery-effects

如何让jQuery中的效果无限制,并且不会停止,因为当我现在运行它时,它只能工作几秒钟(3秒)&在那之后停下来。

例如:

$('div').effect('Slide');

2 个答案:

答案 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);
相关问题