i’m using jquery to bind click and mousemove events to coordinates of the div:
$("#main").live("mousemove click", function(event) {
var x = event.pageX - this.offsetLeft;
var y = event.pageY - this.offsetTop;
if ( event.type == "mousemove" ) {
if ( (x >= 607 && x <= 720) && (y >= 345 && y <= 390) ) {
//cursor:pointer
}
} else //do something on click
what i want to do is to clear this binded events after i ajax load new content to my main div.
thanks!
If you need to unbind the method attached with live() you have to use die();
taken from the docs