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

jQuery callbacks.disable() method

jQuery callbacks.disable() method

jQuery Miscellaneous MethodsjQuery Miscellaneous Methods

Example

Disable the callbacks in a callback list

$

(

function

(

)

{

//

A simple function to be added to the list

var

foo

=

function

(

value

)

{

alert

(

value

)

;

}

;

var

callbacks

= $.

Callbacks

(

)

;

//

Add the above function to the callback list

callbacks

.

add

(

foo

)

;

//

Call all functions in the callback list with the given arguments

callbacks

.

fire

(

"

foo

"

)

;

//

Output: foo

//

Disable the callbacks

callbacks

.

disable

(

)

;

//

Try using "foobar" as the argument

callbacks

.

fire

(

"

foobar

"

)

;

//

foobar will not be output

}

)

Try it »


Definition and Usage

The callbacks.disable() function is used to disable the callbacks in a callback list.

**Tip:** This method returns the callbacks object to the callback list it is bound to.


Syntax

This method does not accept any parameters.

callbacks.disable()


jQuery Miscellaneous MethodsjQuery Miscellaneous Methods