- },
-
- queue: function( elem, type, data ) {
- if ( !elem ) { return; }
-
- type = (type || "fx") + "queue";
- var q = jQuery.data( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( !data ) { return q || []; }
-
- if ( !q || jQuery.isArray(data) ) {
- q = jQuery.data( elem, type, jQuery.makeArray(data) );
- } else {
- q.push( data );
- }
- return q;
- },
-
- dequeue: function( elem, type ){
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ), fn = queue.shift();
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) { fn = queue.shift(); }
-
- if ( fn ) {
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type == "fx" ) { queue.unshift("inprogress"); }
-
- fn.call(elem, function() { jQuery.dequeue(elem, type); });
- }