iframe and onmousemove

K

k.roemke

Hello!
After a longer time I want to do some javascript again.
Task: set content of an iframe to the origin page if the mouse is not
moved


Problem:
<iframe onmousemove="resetCounter();return true;" does not work as
expected.

-> The function resetCounter set back a counter to eg 100.
-> with setTimeOut I can call a function wich counts the counter down
=> If no mousemove happens the counter will reach zero and I can
reload the inital
frame with
frames["mainFrame"].location.href="firstPage.html"

It works if I say in the body tag of firstPage.html:
onMouseMove="parent.resetCounter();"
but then I have to modify each html-page, with is shown in my iFrame.
That is not very nice.

I tried the dom-concept of eventhandling, but I get always the same
problem. If moving over
the iframe I can't catch any event.

Target-Browser ist Firefox, it would be enough, if somebody has a hint
how I could get
Information about the mouse position at an arbitrary point of time,
because in this case
I could check the mouse movement in the function which is periodically
called by setTimeOut

Thanks
Karsten
 
D

darwinist

Hello!
After a longer time I want to do some javascript again.
Task: set content of an iframe to the origin page if the mouse is not
moved


Problem:
<iframe onmousemove="resetCounter();return true;" does not work as
expected.

-> The function resetCounter set back a counter to eg 100.
-> with setTimeOut I can call a function wich counts the counter down
=> If no mousemove happens the counter will reach zero and I can
reload the inital
frame with
frames["mainFrame"].location.href="firstPage.html"

It works if I say in the body tag of firstPage.html:
onMouseMove="parent.resetCounter();"
but then I have to modify each html-page, with is shown in my iFrame.
That is not very nice.

I tried the dom-concept of eventhandling, but I get always the same
problem. If moving over
the iframe I can't catch any event.

Target-Browser ist Firefox, it would be enough, if somebody has a hint
how I could get
Information about the mouse position at an arbitrary point of time,
because in this case
I could check the mouse movement in the function which is periodically
called by setTimeOut

Thanks
Karsten

Yeah I've had trouble trying to get a parent frame to see the mouse
moving on an iframe. You can either overlay it (the iframe) with a
transparent div (which is in the parent frame), or write the
onmousemove code in the document of the child frame, if it's yours.

hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top