Mercurial > nebulaweb3
comparison default/node_modules/jquery/src/queue/delay.js @ 0:1d038bc9b3d2 default tip
Up:default
author | Liny <dev@neowd.com> |
---|---|
date | Sat, 31 May 2025 09:21:51 +0800 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1d038bc9b3d2 |
---|---|
1 define( [ | |
2 "../core", | |
3 "../queue", | |
4 "../effects" // Delay is optional because of this dependency | |
5 ], function( jQuery ) { | |
6 | |
7 "use strict"; | |
8 | |
9 // Based off of the plugin by Clint Helfers, with permission. | |
10 // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ | |
11 jQuery.fn.delay = function( time, type ) { | |
12 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; | |
13 type = type || "fx"; | |
14 | |
15 return this.queue( type, function( next, hooks ) { | |
16 var timeout = window.setTimeout( next, time ); | |
17 hooks.stop = function() { | |
18 window.clearTimeout( timeout ); | |
19 }; | |
20 } ); | |
21 }; | |
22 | |
23 return jQuery.fn.delay; | |
24 } ); |