簡體   English   中英

如何使jQuery效果適用於無限?

[英]How to make a jQuery effects works for infinite?

我怎樣才能使jQuery的效果無限發揮而不會停止,因為當我現在運行它時,它只能工作幾秒鍾(3秒),然后停止。

例如:

$('div').effect('Slide');
(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
  });
})();
setInterval(function(){$('div').effect('slide')}, 1000);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM