:animated

尋找所有正在執行動畫效果的元素。

傳回值

Array<Element>

範例

只有對不在執行動畫效果的元素執行一個動畫特效。

HTML 代碼:

<button id="run">Run</button><div></div>

jQuery 代碼:

$("#run").click(function(){
  $("div:not(:animated)").animate({ left: "+=20" }, 1000);
});

arrow
arrow
    全站熱搜

    mitblog 發表在 痞客邦 留言(0) 人氣()