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

Displaying an image for a few seconds

Status
Not open for further replies.

Kalisto

Programmer
Feb 18, 2003
997
GB
One of my customers has a website that takes in customers information. At the end, they want a "Please wait for a few seconds whilst we process your information" type message to appear on the screen (I was thinking of an animated gif in a div here).

Aparently people are still scared of the instant response a computer gives, and he wants to make it look like the system s struggling to interpret their requiremnets..)

Anyway

Whats the best way of generating a few seconds time delay in javacript, and then when the timer is done, switching off the div.

(Im guessing that this needs to be a function that is called in the Body OnLoad event, but Im no JS expert, so hopefully someone here can help me out.)
K
 
>Whats the best way of generating a few seconds time delay in javacript...

You can use setTimeout().

The div can be created dynamically or use display style to control its appearance so that it displays when needed. When time's up (setTimeout()), it is removed or display style resetted to "none".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top