Get the coordinates of the mouse on the page:
I personally don't understand compactmode, the so-called rendering mode.
Code
<SCRIPT type = "text/JavaScript">
<! --
// Add an onclick event for mouse clicks on the page.
Document. onclick = function (E)
{
VaR target = (E & e.tar get) | (event & event. srcelement );
// Click the coordinates on the page
VaR axisx = Window. event. clientx;
VaR asixy = getscrolltop () + window. event. clienty;
}
// Obtain the height of the scroll bar
Function getscrolltop (){
VaR scrollpos = 0;
If (typeof window. pageyoffset! = 'Undefined '){
Scrollpos = Window. pageyoffset;
}
Else if (typeof upload Doc ument. compatmode! = 'Undefined '&&
Window.doc ument. compatmode! = 'Background '){
Scrollpos = registry.document.doc umentelement. scrolltop;
}
Else if (typeof alert Doc ument. Body! = 'Undefined '){
Scrollpos = zookeeper Doc ument. Body. scrolltop;
}
Return scrollpos;
}
// -->
</SCRIPT>