How can I get a value that's updated from inside an event handler ?
For example, I have the following in which I want the coordinates to be returned from the handler:
var mx, my;
function handler(evt){
mx = evt.pageX; my = evt.pageY;
console.log(mx, my); // works good
// Say I want to return x coordinate
return mx;
}
var retMX = $("div.test1").mouseleave(handler); // this doesn't happen, how can I make something of this sort?