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 ), fn = queue.shift();
32 // If the fx queue is dequeued, always remove the progress sentinel
33 if ( fn === "inprogress" ) {
38 // Add a progress sentinel to prevent the fx queue from being
39 // automatically dequeued
40 if ( type === "fx" ) {
41 queue.unshift("inprogress");
44 fn.call(elem, function() {
45 jQuery.dequeue(elem, type);
52 queue: function( type, data ) {
53 if ( typeof type !== "string" ) {
58 if ( data === undefined ) {
59 return jQuery.queue( this[0], type );
61 return this.each(function( i ) {
62 var queue = jQuery.queue( this, type, data );
64 if ( type === "fx" && queue[0] !== "inprogress" ) {
65 jQuery.dequeue( this, type );
69 dequeue: function( type ) {
70 return this.each(function() {
71 jQuery.dequeue( this, type );
75 // Based off of the plugin by Clint Helfers, with permission.
76 // http://blindsignals.com/index.php/2009/07/jquery-delay/
77 delay: function( time, type ) {
78 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
81 return this.queue( type, function() {
83 setTimeout(function() {
84 jQuery.dequeue( elem, type );
89 clearQueue: function( type ) {
90 return this.queue( type || "fx", [] );