Click to See Complete Forum and Search --> : Loop help


alexthomas
02-19-2003, 09:54 AM
Could i have some help with this probably very simple proplem.


basicaly when the time reaches 18 seconds i would like it to reset to 0 then loop through the code again, then this to continue after every 18 seconds.

Heres the code:

<html>
<head>
<title> Frame 1a </title>
<script language="JavaScript">
function init() {
setTimeout("window.main.location.href = 'frame1a.htm'", 0 * 1000);
setTimeout("window.main.location.href = 'frame1b.htm'", 6 * 1000);
setTimeout("window.main.location.href = 'frame1c.htm'", 12 * 1000);
}
</script>
</head>
<frameset rows="100%,*" onload="init()">
<frame name="main" src="0.htm">
</frameset>
</html>

Cheers

Al

Sergey Smirnov
02-19-2003, 11:42 AM
try:
function init() {
setTimeout("window.main.location.href = 'frame1a.htm'", 0 * 1000);
setTimeout("window.main.location.href = 'frame1b.htm'", 6 * 1000);
setTimeout("window.main.location.href = 'frame1c.htm'", 12 * 1000);
setTimeout("init()",18 * 1000);
}