Примеры для jQuery .die()


To unbind all live events from all paragraphs, write:

1
$( "p" ).die();

To unbind all live click events from all paragraphs, write:

1
$( "p" ).die( "click" );

To unbind just one previously bound handler, pass the function in as the second argument:

1
2
3
4
5
6
7
8
9
var foo = function() {
// Code to handle some kind of event
};
// Now foo will be called when paragraphs are clicked
$( "p" ).live( "click", foo );
// Now foo will no longer be called
$( "p" ).die( "click", foo );