scratch – Diff between revs 58 and 125
?pathlinks?
Rev 58 | Rev 125 | |||
---|---|---|---|---|
Line 1... | Line 1... | |||
1 | define( [ |
1 | define([ |
|
2 | "../core", |
2 | "../core", |
|
3 | "../queue", |
3 | "../queue", |
|
4 | "../effects" // Delay is optional because of this dependency |
4 | "../effects" // Delay is optional because of this dependency |
|
5 | ], function( jQuery ) { |
5 | ], function( jQuery ) { |
|
Line 6... | Line -... | |||
6 | |
- | ||
7 | "use strict"; |
- | ||
8 | |
6 | |
|
9 | // Based off of the plugin by Clint Helfers, with permission. |
7 | // 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/ |
8 | // http://blindsignals.com/index.php/2009/07/jquery-delay/ |
|
11 | jQuery.fn.delay = function( time, type ) { |
9 | jQuery.fn.delay = function( time, type ) { |
|
12 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; |
10 | time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; |
|
Line 13... | Line 11... | |||
13 | type = type || "fx"; |
11 | type = type || "fx"; |
|
14 | |
12 | |
|
15 | return this.queue( type, function( next, hooks ) { |
13 | return this.queue( type, function( next, hooks ) { |
|
16 | var timeout = window.setTimeout( next, time ); |
14 | var timeout = setTimeout( next, time ); |
|
17 | hooks.stop = function() { |
15 | hooks.stop = function() { |
|
18 | window.clearTimeout( timeout ); |
16 | clearTimeout( timeout ); |
|
19 | }; |
17 | }; |
|
Line 20... | Line 18... | |||
20 | } ); |
18 | }); |
|
21 | }; |
19 | }; |