ahle / Tconnect

a trace based platform for collecting, reasoning and visualizing interaction traces
0 stars 1 forks source link

The mouse events and its positions is not cross-browser #3

Open ahle opened 11 years ago

ahle commented 11 years ago

if(!e) var e = window.event; var posx = 0; var posy = 0; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; }