4 queue: function( elem, type, data ) {
9 type = (type || "fx") + "queue";
10 var q = jQuery.data( elem, type );
12 // Speed up dequeue by getting out quickly if this is just a lookup
17 if ( !q || jQuery.isArray(data) ) {
18 q = jQuery.data( elem, type, jQuery.makeArray(data) );
27 dequeue: function( elem, type ) {
30 var queue = jQuery.queue( elem, type ),
33 // If the fx queue is dequeued, always remove the progress sentinel
34 if ( fn === "inprogress" ) {
39 // Add a progress sentinel to prevent the fx queue from being
40 // automatically dequeued
41 if ( type === "fx" ) {
42 queue.unshift("inprogress");
45 fn.call(elem, function() {
46 jQuery.dequeue(elem, type);
53 queue: function( type, data ) {
54 if ( typeof type !== "string" ) {
59 if ( data === undefined ) {
60 return jQuery.queue( this[0], type );
62 return this.each(function( i ) {
63 var queue = jQuery.queue( this, type, data );
65 if ( type === "fx" && queue[0] !== "inprogress" ) {
66 jQuery.dequeue( this, type );
70 dequeue: function( type ) {
71 return this.each(function() {
72 jQuery.dequeue( this, type );
76 // Based off of the plugin by Clint Helfers, with permission.
77 // http://blindsignals.com/index.php/2009/07/jquery-delay/
78 delay: function( time, type ) {
79 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
82 return this.queue( type, function() {
84 setTimeout(function() {
85 jQuery.dequeue( elem, type );
90 clearQueue: function( type ) {
91 return this.queue( type || "fx", [] );