Blame view
app/bower_components/jquery/src/queue/delay.js
636 Bytes
87c93a029
|
1 |
define( [ |
f986e111b
|
2 3 4 5 |
"../core", "../queue", "../effects" // Delay is optional because of this dependency ], function( jQuery ) { |
87c93a029
|
6 |
"use strict"; |
f986e111b
|
7 |
// Based off of the plugin by Clint Helfers, with permission. |
87c93a029
|
8 |
// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ |
f986e111b
|
9 10 11 12 13 |
jQuery.fn.delay = function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { |
87c93a029
|
14 |
var timeout = window.setTimeout( next, time ); |
f986e111b
|
15 |
hooks.stop = function() { |
87c93a029
|
16 |
window.clearTimeout( timeout ); |
f986e111b
|
17 |
}; |
87c93a029
|
18 |
} ); |
f986e111b
|
19 20 21 |
}; return jQuery.fn.delay; |
87c93a029
|
22 |
} ); |