Line 9: | Line 9: | ||
var offset1 = document.getElementById("team").offsetLeft; | var offset1 = document.getElementById("team").offsetLeft; | ||
var offset2 = document.getElementById("team").offsetTop; | var offset2 = document.getElementById("team").offsetTop; | ||
− | + | ||
var x=0; //e.pageX; | var x=0; //e.pageX; | ||
var y=0; //e.pageY; | var y=0; //e.pageY; | ||
Line 16: | Line 16: | ||
if (e.pageX || e.pageY) | if (e.pageX || e.pageY) | ||
{ | { | ||
− | |||
x = e.pageX - offset1; | x = e.pageX - offset1; | ||
y = e.pageY - offset2; | y = e.pageY - offset2; | ||
Line 22: | Line 21: | ||
else if (e.clientX || e.clientY) | else if (e.clientX || e.clientY) | ||
{ | { | ||
− | |||
x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft - offset1; | x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft - offset1; | ||
y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop - offset2; | y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop - offset2; |
Revision as of 19:57, 1 November 2017