资 源 简 介
jQuery 1.5 introduced the Deferred callback management system, to ease handling callbacks for asynchronous events. Although the jQuery documentation contains examples on how to use Deferred objects with the native window.setTimeout and window.clearTimeout functions, jQuery does not provide a simple interface for timer-based Deferreds by its own.
This plugin provides a single function jQuery.timeout that, given a delay in milliseconds, creates a jQuery.Deferred instance that will be resolved after the given delay. The returned object also provides a clear method, which will reject the Deferred object and clear the native timeout ID if called before the timeout has elapsed.
Since version 1.1.0, both timeout and delay support optional arguments that are passed to the Deferred"s doneCallbacks.
News
As