How about this:
<html>
<head>
<script>
var msgDiv;
function moveMouse(){
e = window.frames.myFrame.even
msgDiv.innerHTML = e.x+":"+e.y;
}
function init(){
msgDiv = document.getElementById("m
window.frames.myFrame.docu
}
</script>
</head>
<body>
<div id="mPos"></div>
<iframe name="myFrame" src="mypage.htm" onLoad="init()"></iframe>
</body>
</html>
Main Topics
Browse All Topics





by: ZylochPosted on 2004-08-03 at 15:02:24ID: 11710542
Which mouse event are you talking about?
creenX+',' +event.scr eenY);">
onmousemove on the main page doesn't work on iframe. If you want the mouse position over the iframe compared to the whole screen, put this code in the <body> tag of the iframe:
<body onmousemove="alert(event.s
Then, in your main page with the iframe, have the same code in the <body>. This should definitely work for both over iframe and over main page, although you'd probably want to store the value into a variable instead of alerting (if you get stuck in an alert loop, move you mouse off the window. Press Enter, then do AltF4)
Regards,
${Zyloch}