<html>
<head>
<script type="text/javascript">
window.onload = init;
function init() {
if (window.Event) {
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousedown = getPosition;
}
function getPosition(e) {
xPos = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
yPos = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
alert("X: " + xPos + " Y: " + yPos);
}
</script>
</head>
<body>
</body>
</html>
- <html>
- <head>
- <script type="text/javascript">
-
- window.onload = init;
- function init() {
- if (window.Event) {
- document.captureEvents(Event.MOUSEMOVE);
- }
- document.onmousedown = getPosition;
- }
- function getPosition(e) {
- xPos = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
- yPos = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
-
- alert("X: " + xPos + " Y: " + yPos);
- }
-
- </script>
- </head>
- <body>
-
- </body>
- </html>
Probado en FF3.5 y IE7. Esto te lleva a la posición, pero theres de diferentes maneras de ir sobre la persistencia de esos valores a un PP, de modo que depende de sus necesidades. Si usted necesita que sea ágil, entonces usted podrÃa cable hasta una llamada AJAX a tu idioma favorito de SS y salvar de esa manera.
I'd love to change the world, but they won't give me the source code.