返回值:jQuerydequeue(name)

概述

从队列最前端移除一个队列函数,并执行他。

参数

nameString

队列名,默认为fx

示例

描述:

用dequeue来结束自定义队列函数,并让队列继续进行下去。

HTML 代码:
<style>
  div { margin:3px; width:50px; position:absolute;
        height:50px; left:10px; top:30px; 
        background-color:yellow; }
  div.red { background-color:red; }
  </style>

  <button>Start</button>
  <div></div>
jQuery 代码:
$("button").click(function () {
      $("div").animate({left:'+=200px'}, 2000);
      $("div").animate({top:'0px'}, 600);
      $("div").queue(function () {
          $(this).toggleClass("red");
          $(this).dequeue();
      });
      $("div").animate({left:'10px', top:'30px'}, 700);
  });