Hi all. I've the next code:

$("#box").live("mouseover", function(){ $(this).addClass
("highlight"); });
$("#box").live("mouseout", function(){ $(this).removeClass
("highlight"); });

$("#box").live("click", function(){ alert("Hi"); });

$("#erase").bind('click', function() {
       $("#box").die("click");
});


So, what I want to do is simple, I asign mouseover and mouseout
"highlight" effect to a div. And if you click the div then you get an
alert. This works nice.

Then, if you click a link with id="erase", the click event bound to
the #box must be deleted. With .die it's done nicely but, this is the
rare behaviour, the other live events are unbound too (mouseover, and
mouseout).

The Docs says that using this sintax .die("click") then only the click
events must be unbound. ¿I am wrong?

Thanks.

Reply via email to