I have a site that uses AJAX for navigation. I have two pages in which I use the click and drag function with
$(".myDragArea").mousedown(function(){
do stuff...
mouseDrag = true;
});
$("body").mousemove(function(){
if (mouseDrag) {
do stuff...
}
});
$("body").mouseup(function(){
if (mouseDrag) {
do stuff...
mouseDrag = false;
}
});
I'm just typing this, so I apologize for random syntax errors. Two parts of the site use an almost identical code, with the only difference being inside the function $("body").mouseup(). However, if I get access to the first part, then go to the second part, the code that works in mouseup does not change. I went through the code using firebug and no errors or throws at startup $("body").mouseup()when loading the second part.
So why doesn't the event handler change when I run the $("body").mouseup()second time?