View Single Post
Old 06-06-2004, 11:47 PM  
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
Quote:
Originally posted by TheJimmy
anyone know how to display a form/button after a specified time delay?


like I want an html page to have some text, bla bla bla, then after about 20seconds on that same page I want a form/button to show up...
Two relatively painless ways of handling this.

Method 1 - Put your form inside a DIV that's visibility: hidden. Start your timeout and have your callback un-hide the DIV.

Method 2 - Put an empty DIV where you want your form to appear. When your timeout runs, put the entire content of your form into the DIV using innerHTML.

I've used both methods successfully, although the second one can be a bit of a PITA due to size limitations of static strings in js... I tend to use that more for dynamic regeneration of display elements.

HTH. HAND.
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote