By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,569 Members | 1,350 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,569 IT Pros & Developers. It's quick & easy.

iframe and onmousemove

P: n/a
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

Aug 3 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
k.******@gmx.de wrote:
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.
---
http://darwinist.googlepages.com/htmldesktop.html
(lots of working examples)

Aug 5 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.