callbacks.disable()S2C Home « Objects « callbacks.disable()

Disable a callbacks list.


The callbacks.disable() Callbacks object method, disables a callback list.


Signature Description
callbacks.disable()Disable a callback list.





callbacks.disable() Examplego to top of page Top

Disable a callback list.

In the example below when we press the button the first time we add the aFunc(value, div) function to our callbacks list and then fire the list off. After this we disable the list and then try to add and fire the bFunc(value, div) function. Because the callback list is now disabled nothing happens.

  $('#btn7').one('click', function(){
    var ourCallbacks = $.Callbacks();
    ourCallbacks.add( aFunc ); 'The aFunc function was fired from our callbacks. <br />', '#div7');
    ourCallbacks.add( bFunc ); 'The bFunc function was fired from our callbacks. <br />', '#div7');
  function aFunc( value, div ){
    $(div).append( value);
  function bFunc( value, div ){
    aFunc('Passing bFunc function value to aFunc. <br />', div);

div7. Some initial text.

Press the button below to action the above code:

go to home page Homepage go to top of page Top