返回值:jQueryqueue(name, queue)
概述
将匹配元素的队列用新的一个队列来代替(函数数组).
参数
nameString
队列名,默认为fx
queueArray<Function>
用于替换的队列。所有函数都有同一个参数,这个值与queue(callback)相同
示例
描述:
通过设定队列数组来删除动画队列
HTML 代码:
<style>
  div { margin:3px; width:40px; height:40px;
        position:absolute; left:0px; top:30px; 
        background:green; display:none; }
  div.newcolor { background:blue; }
  </style>
  <button id="start">Start</button>
  <button id="stop">Stop</button>
  <div></div>jQuery 代码:
$("#start").click(function () {
      $("div").show("slow");
      $("div").animate({left:'+=200'},5000);
      $("div").queue(function () {
          $(this).addClass("newcolor");
          $(this).dequeue();
      });
      $("div").animate({left:'-=200'},1500);
      $("div").queue(function () {
          $(this).removeClass("newcolor");
          $(this).dequeue();
      });
      $("div").slideUp();
  });
  $("#stop").click(function () {
      $("div").queue("fx", []);
      $("div").stop();
  });