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

Delay show/hide layer for 2 seconds

Status
Not open for further replies.

Diggum1

Programmer
Oct 14, 2004
67
US
How can I delay the firing of this function by 2 seconds? The following is not working.


function showlayer(whichLayer) {

document.getElementById(whichLayer).style.display = 'block';
setTimeout("showlayer()",2000);
}


Thanks
Rick

 
you will need to do it from wherever you're calling the function.

for example:

Code:
<input type="button" onclick="setTimeout('showlayer(\'theLayerId\')', 2000);" value="hi" />



*cLFlaVA
----------------------------
[tt]somebody set up us the bomb![bomb][/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top