Line 14: | Line 14: | ||
if (!e) var e = window.event; | if (!e) var e = window.event; | ||
− | + | if (e.pageX || e.pageY) | |
− | + | { | |
− | + | alert("1"); | |
− | + | x = e.pageX; | |
− | + | y = e.pageY; | |
+ | } | ||
if (e.clientX || e.clientY) | if (e.clientX || e.clientY) | ||
{ | { | ||
+ | alert("2"); | ||
x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; | x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; | ||
y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; | y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; |
Revision as of 19:48, 1 November 2017