在主页面下:如果左右两FRAME的名称分别是:leftFrame,rightFrame则可在左FRAME中的setTimeout使用时就采用 <变量>=setTimeout("函数名",延时)
如:thisTimeout=setTimeout("xyz()",1000)
注意:关键是前面必须有变量thisTimeout
这时你可在右FRAME中加上以下控制<input type=button value="暂停" onclick=clearTimeout(parent.leftFrame.thisTimeout)>
<input type=button value="继续" onclick=parent.leftFrame.xyz()>
如:thisTimeout=setTimeout("xyz()",1000)
注意:关键是前面必须有变量thisTimeout
这时你可在右FRAME中加上以下控制<input type=button value="暂停" onclick=clearTimeout(parent.leftFrame.thisTimeout)>
<input type=button value="继续" onclick=parent.leftFrame.xyz()>
清除 clearTimeout(timer1);
如果要停止别的页面的定时器,需取得timer1的引用
<frameset cols="*,80" frameborder="NO" border="0" framespacing="0">
<frame src="" name="leftFrame">
<frame src="" name="rightFrame" scrolling="NO" noresize>
</frameset>
在右页面停止左页面的timer1:
top.leftFrame.clearTimeout(top.leftFrame.timer1)