Line 17: | Line 17: | ||
{ | { | ||
alert(e.pageY); | alert(e.pageY); | ||
− | x = e.pageX; | + | x = e.pageX - offset1; |
− | y = e.pageY; | + | y = e.pageY - offset2; |
} | } | ||
else if (e.clientX || e.clientY) | else if (e.clientX || e.clientY) | ||
{ | { | ||
alert("2"); | alert("2"); | ||
− | x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; | + | x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft - offset1; |
− | y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; | + | y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop - offset2; |
} | } | ||
− | alert(y | + | alert(y); |
if(x>=52) | if(x>=52) |
Revision as of 19:55, 1 November 2017