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);
50 if ( !queue.length ) {
51 jQuery.removeData( elem, type + "queue", true );
57 queue: function( type, data ) {
58 if ( typeof type !== "string" ) {
63 if ( data === undefined ) {
64 return jQuery.queue( this[0], type );
66 return this.each(function( i ) {
67 var queue = jQuery.queue( this, type, data );
69 if ( type === "fx" && queue[0] !== "inprogress" ) {
70 jQuery.dequeue( this, type );
74 dequeue: function( type ) {
75 return this.each(function() {
76 jQuery.dequeue( this, type );
80 // Based off of the plugin by Clint Helfers, with permission.
81 // http://blindsignals.com/index.php/2009/07/jquery-delay/
82 delay: function( time, type ) {
83 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
86 return this.queue( type, function() {
88 setTimeout(function() {
89 jQuery.dequeue( elem, type );
94 clearQueue: function( type ) {
95 return this.queue( type || "fx", [] );