Latest web development tutorials

jQuery.holdReady () method

jQuery Event Methods jQuery Event Methods

Examples

Right-click an HTML element triggering event

<Button id = "first"> Click the pop-up Test </ button> <Button id = "second"> release delay </ button> <Script>
$. HoldReady (true) $ ( document). Ready (function () {$ ( "#first"). Click (function () { alert ( "Release delay after the pop-up");}) }) $ ( "#second") Click (function (.) {$ HoldReady (false);.})
</ Script>

try it"

Definition and Usage

$ .holdReady ()Function is used to pause or resume .ready () event executed.

Note: 1. This method must be called in the front part of the document, for example, after the head has loaded jQuery script, the method is called immediately. If this method is called after the ready event has been called, it will not work.
2. The first call $ .holdReady (true) [after calling ready event is locked]. When ready to execute ready event, call the $ .holdReady (false).
3. The event can be ready to add multiple locks, each lock corresponds to a $ .holdReady (false) [unlock] call. ready event will have been lifted in all the locks, and the page also has a good case to be ready for the next trigger.



grammar

$.holdReady( hold )

参数 描述
hold Boolean类型 指示暂停或恢复被请求的ready事件


jQuery Event Methods jQuery Event Methods