fn_b/node_modules/jquery/src/queue/delay.js
2026-02-12 13:55:43 +08:00

18 lines
500 B
JavaScript
Executable File

import { jQuery } from "../core.js";
import "../queue.js";
import "../effects.js"; // Delay is optional because of this dependency
// Based off of the plugin by Clint Helfers, with permission.
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 ) {
var timeout = window.setTimeout( next, time );
hooks.stop = function() {
window.clearTimeout( timeout );
};
} );
};