Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery callbacks.disabled() method

jQuery callbacks.disabled() method

jQuery Miscellaneous MethodsjQuery Miscellaneous Methods

Example

Determine whether a callback list has been disabled

$

(

function

(

)

{

//

A simple function to be added to the callback list

var

foo

=

function

(

value

)

{

alert

(

"

foo:

"

value

)

;

}

;

var

callbacks

= $.

Callbacks

(

)

;

//

Add a function to the callback list

callbacks

.

add

(

foo

)

;

//

Pass an argument to the list parameter

callbacks

.

fire

(

"

hello

"

)

;

//

Output "foo: hello"

//

Disable the callback list

callbacks

.

disable

(

)

;

//

Test the disabled state of the list

alert

(

callbacks

.

disabled

(

)

)

;

//

Output: true

}

)

Try it »


Definition and Usage

The callbacks.disabled() function is used to determine whether a callback list has been disabled.


Syntax

This method does not accept any parameters.

callbacks.disabled()


jQuery Miscellaneous MethodsjQuery Miscellaneous Methods