clear

英[kl??(r)]? ?美[kl?r]??

adj.明確的;清澈的;清楚的,懂的;清晰的,明亮的

adv.完全地;清晰地;整整

vi.變明朗;變清澈

vt.掃除,除去;消除(嫌疑);使清楚;使乾淨

n.空隙,空間

queue

#英[kju:]? ?美[kju]??

#n.(人或車輛)行列,長隊;辮子

vi.(人、車等)排隊等候

vt.(使)排隊,列隊等待

jquery 清除佇列方法 語法

作用:clearQueue() 方法停止佇列中所有仍未執(zhí)行的函數(shù)。與 stop() 方法不同,(只適用於動畫),clearQueue() 能夠清除任何排隊的函數(shù)(透過 .queue() 方法新增至通用 jQuery 佇列的任何函數(shù))。

語法:$(selector).clearQueue(queueName)

##參數(shù):

參數(shù)描述queueName可選。規(guī)定要停止的隊列的名稱。預設是 "fx",標準效果隊列。

jquery 清除佇列方法 範例

<html>
<head>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript"> 
$(document).ready(function(){
  $("#start").click(function(){
    $("#box").animate({height:300},"slow");
    $("#box").animate({width:300},"slow");
    $("#box").queue(function () {
      $(this).css("background-color","red");  
      $(this).dequeue();
    });
    $("#box").animate({height:100},"slow");
    $("#box").animate({width:100},"slow");
  });
  $("#stop").click(function(){
    $("#box").clearQueue();
  });
});
</script>
</head>
<body>

<p><button id="start">Start Animation</button><button id="stop">Stop Animation</button></p>
<div id="box" style="background:#98bf21;height:100px;width:100px;position:relative">
</div>
</body>
</html>
執(zhí)行實例 ?

#點擊 "執(zhí)行實例" 按鈕查看線上實例

#
<samp id="cm64o"><button id="cm64o"></button></samp>
    <acronym id="cm64o"><li id="cm64o"></li></acronym>
    <code id="cm64o"></code>