Where is my mouse?
From Wikiid
<form name="exf1">
Mouse X <input type="text" name="x" value="unknown">
Mouse Y <input type="text" name="y" value="unknown">
</form>
<script type=text/javascript>
var isIE = document.all?true:false;
if (!isIE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMousePosition;
function getMousePosition(e) {
var _x;
var _y;
if (!isIE) {
_x = e.pageX;
_y = e.pageY;
}
if (isIE) {
_x = event.clientX + document.body.scrollLeft;
_y = event.clientY + document.body.scrollTop;
}
document.exf1.x.value=_x;
document.exf1.y.value=_y;
return true;
}
</script>
Wikiid Pages relating to JavaScript in Wiki (edit) |
Centigrade/Farenheit converter |
Sniffer - What can JavaScript see |
Where is my mouse? |
Rock band name generator |