2 queue: function( elem, type, data ) {
3 if ( !elem ) { return; }
5 type = (type || "fx") + "queue";
6 var q = jQuery.data( elem, type );
8 // Speed up dequeue by getting out quickly if this is just a lookup
9 if ( !data ) { return q || []; }
11 if ( !q || jQuery.isArray(data) ) {
12 q = jQuery.data( elem, type, jQuery.makeArray(data) );
19 dequeue: function( elem, type ){
22 var queue = jQuery.queue( elem, type ), fn = queue.shift();
24 // If the fx queue is dequeued, always remove the progress sentinel
25 if ( fn === "inprogress" ) { fn = queue.shift(); }
28 // Add a progress sentinel to prevent the fx queue from being
29 // automatically dequeued
30 if ( type == "fx" ) { queue.unshift("inprogress"); }
32 fn.call(elem, function() { jQuery.dequeue(elem, type); });
38 queue: function(type, data){
39 if ( typeof type !== "string" ) {
44 if ( data === undefined ) {
45 return jQuery.queue( this[0], type );
47 return this.each(function(i, elem){
48 var queue = jQuery.queue( this, type, data );
50 if ( type == "fx" && queue[0] !== "inprogress" ) {
51 jQuery.dequeue( this, type );
55 dequeue: function(type){
56 return this.each(function(){
57 jQuery.dequeue( this, type );
61 // Based off of the plugin by Clint Helfers, with permission.
62 // http://blindsignals.com/index.php/2009/07/jquery-delay/
63 delay: function( time, type ) {
64 time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
67 return this.queue( type, function() {
69 setTimeout(function() {
70 jQuery.dequeue( elem, type );
75 clearQueue: function(type){
76 return this.queue( type || "fx", [] );