/    Sign up×
Community /Pin to ProfileBookmark

Can anyone tell me how to create a delay display for my web page using Javascript or…anything else .

It will display a countdown timer that i can set and when the time reach zero , my webpage will display the contents .

Anyone ?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@justinbarneskinJul 29.2009 — Set the css body style display to "none" and then change it to "block" with your code.

Or if you simply wish to wait for the entire page to load and then display--

<body onload="this.style.display='block'">
Copy linkTweet thisAlerts:
@justinbarneskinJul 29.2009 — oh yeah, the timer... Well, you'll need two divs

One will act as the container for everything you would have in the body

to be display:none

while the other div or span would display:block with the count down and your little animated clock

var count=10;

function cdown(){

document.getElementById('cdDiv').innerHTML=count; count--

if(count===0){document.getElementById('cdDiv').display='none';

document.getElementById('displayPage').style.display='block'; return}

setTimeout("cdown()",1000)

}
Copy linkTweet thisAlerts:
@justinbarneskinJul 29.2009 — You'll need to add that code with script tags just after your html creates the cdDiv ID

if count reaches zero and the other div has yet to be created because of a server error, well anyone would just refresh the page or surf along to the next freak show.
Copy linkTweet thisAlerts:
@AqnimeauthorJul 30.2009 — wow ! Thanks ! Thank you very much Justin ^^
×

Success!

Help @Aqnime spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...