Here is what i cannot get to work - in mouseMove this.mouseX is undefined. I need the mouseX and mouseY (e.pageX in code) from mousemove event.
function myClass () {
var mouseX=x;
var mouseY=y;
$(document).mousemove(this.mouseMove);
}
myClass.prototype.mouseMove = function(e){
this.mouseX=e.pageX;//not a good idea but you can alert this
}
var a=new myClass();
Can i get that event passed to the supposed class instance or there is no way to get it done?
I should also mention i am trying to avoid global scope variables here.