jQuery callbacks.locked()Method

jQuery 杂项方法jQuery Miscellaneous Methods

Example

Use callbacks.disabled() to determine whether the callback list has been locked

$(function () { //A simple test function var foo = function( value ) { alert( "foo:" + value ); }; var callbacks = $.Callbacks(); //Add the test function foo to the list callbacks.add( foo ); //Call all callbacks with the passed arguments callbacks.fire( "hello" ); //Output "foo: hello" //Lock the callback list callbacks.lock(); //Test the status of the callback list alert( callbacks.locked() ); // true })

Try it Yourself »

Definition and Usage

The callbacks.locked() function is used to determine whether the callback list has been locked.


Syntax

This method does not accept any parameters.

callbacks.locked()


jQuery 杂项方法jQuery Miscellaneous Methods

Other extensions