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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with SetInterval

Status
Not open for further replies.

rangerstud620

Programmer
Sep 17, 2003
34
0
0
US
I'd like to set up a page that uses SetInterval to show 7 layers when the page loads. I have a basic knowledge of javascript, but I haven't used it in awhile so any help you can offer would be a huge help. Thanks in advance!!!

P.S. I'm using Dreamweaver to create this site.
 
rangerstud620,

I used spans building the test give it a whril:
Code:
<html><head><title>TEST</title>
<script language=&quot;Javascript&quot;>
var num = 1;
function mkv() {
  document.getElementById(&quot;layer&quot;+num).style.visibility = 'visible';
  num++
  if(num == 5) { clearInterval(tm); }
}
</script>
</head>
<body onLoad='tm=setInterval(&quot;mkv()&quot;,2000)'>
<hr align=&quot;center&quot; width=&quot;60%&quot; size=&quot;1&quot;>
<span align=&quot;left&quot; id=&quot;layer1&quot; style=&quot;visibility: hidden;&quot;>
This is the first span it's id is layer1.</span><br>
<span align=&quot;center&quot; id=&quot;layer2&quot; style=&quot;visibility: hidden;&quot;>
This is the second span it's id is layer2.</span><br>
<span align=&quot;center&quot; id=&quot;layer3&quot; style=&quot;visibility: hidden;&quot;>
This is the second span it's id is layer3.</span><br>
<span align=&quot;center&quot; id=&quot;layer4&quot; style=&quot;visibility: hidden;&quot;>
This is the second span it's id is layer4.</span><br></body></html>

2b||!2b
 
Thanks alot Lrnmore!!! That should work great for what I'm trying to do. Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top