Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Frames with Timer

Status
Not open for further replies.

kgreer

MIS
Jul 18, 2003
155
US
ok, let me see if I can explain my situation.....


I have set up a page with two frames, code below:
<FRAMESET FRAMEBORDER=1 FRAMESPACING=0 cols=298,* framecolor="#000000">
<FRAME SCROLLING="NO" name=MENU src="Menuconnection.htm">
<FRAME SCROLLING="NO" name=MAIN src="Main.htm">
</FRAMESET>


What I want to do is to detect if the mouse has not been moved,clicked or even if the keyboard has not been moved or clicked within a certain time limit. If both of these is true I want to reset the page. I have been able to write the code to detect this for the first frame. Code below:
function CountDown()
{
iTimeLeft -= 1;
if (iTimeLeft == 0)
{
iTimeLeft = 5
if (lastChangeObj != "")
{
lastChangeObj.style.color = "Gray"
lastChangeObj = ""
}
document.frmMain.submit()
}
setTimeout("CountDown()",1000)
}
setTimeout("CountDown()",1000)
then on the body tag I put this code:
<body onmousemove="ResetTimer()" onmousedown="ResetTimer()" onkeydown="ResetTimer()" onkeyup="ResetTimer()">

This works great if the mouse stays on the left frame, but if you put the mouse on the right frame then the code still runs within the right frame,


So I quess what I am looking for is away to determine if the mouse has been moved at all on the entire page, not within the Frames.
 
I have put the code in both frames, but how do you know which one to run, if your in one frame the other frame doesn't know that your mouse is over the other frame. I also tried to put it on the main frame, but know luck either.
 
The problem I am getting is when I load a PDF or a PPT file in the one frame. How do I get Mouse movement on that frame when this is open??????????????


HELP>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top