2 queue: function( elem, type, data ) {
7 type = (type || "fx") + "queue";
8 var q = jQuery.data( elem, type );
10 // Speed up dequeue by getting out quickly if this is just a lookup
15 if ( !q || jQuery.isArray(data) ) {
16 q = jQuery.data( elem, type, jQuery.makeArray(data) );
25 dequeue: function( elem, type ) {
28 var queue = jQuery.queue( elem, type ), fn = queue.shift();
30 // If the fx queue is dequeued, always remove the progress sentinel
31 if ( fn === "inprogress" ) {
36 // Add a progress sentinel to prevent the fx queue from being
37 // automatically dequeued
38 if ( type === "fx" ) {
39 queue.unshift("inprogress");
42 fn.call(elem, function() {
43 jQuery.dequeue(elem, type);
50 queue: function( type, data ) {
51 if ( typeof type !== "string" ) {
56 if ( data === undefined ) {
57 return jQuery.queue( this[0], type );
59 return this.each(function( i, elem ) {
60 var queue = jQuery.queue( this, type, data );
62 if ( type === "fx" && queue[0] !== "inprogress" ) {
63 jQuery.dequeue( this, type );
67 dequeue: function( type ) {
68 return this.each(function() {
69 jQuery.dequeue( this, type );
73 // Based off of the plugin by Clint Helfers, with permission.
74 // http://blindsignals.com/index.php/2009/07/jquery-delay/
75 delay: function( time, type ) {
76 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
79 return this.queue( type, function() {
81 setTimeout(function() {
82 jQuery.dequeue( elem, type );
87 clearQueue: function( type ) {
88 return this.queue( type || "fx", [] );