I am developing a web page where I have set an image in a The question is: how to get m
I solved this problem with this code
var CurX;
var CurY;
var IE = document.all?true:false;
if(IE){
CurX = window.event.clientX;
CurY = window.event.clientY;
}
else{
if (window.captureEvents) {
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = getCursorXY;
}
function getCursorXY(e) {
CurX = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
CurY = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
}