Countdown timer

By Massimo v Massimo v

Description

This is a simple countdown timer. I Slightly edited it to fit for the holidays.

Code

<script type="text/javascript">
today = new Date();
BigDay = new Date("December 25, 2014"); // Change date to countdown to
msPerDay = 24 * 60 * 60 * 1000 ;
timeLeft = (BigDay.getTime() - today.getTime());
e_daysLeft = timeLeft / msPerDay;
daysLeft = Math.floor(e_daysLeft);
e_hrsLeft = (e_daysLeft - daysLeft)*24;
hrsLeft = Math.floor(e_hrsLeft);
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);
document.write("Er zijn nog maar : <BR> <H4>" + daysLeft + " dagen " + hrsLeft +" Uren " + minsLeft + " minuten over</H4> Tot het Kerstmis is! <P>"); // you can change the words, Don't change the methods 
// origineel afkomstig van moonfruit.com Aangepast door Massimo methode aangepast en vertaald 
</script>

Blank version ( for easy editing)
Dont forget the html tag when inserting

<script type="text/javascript">
today = new Date();
BigDay = new Date("Month dayofmonth, year"); // Change date to the day you would like to countdown to
msPerDay = 24 * 60 * 60 * 1000 ; // Vbs
timeLeft = (BigDay.getTime() - today.getTime());// Vbs
e_daysLeft = timeLeft / msPerDay;// Vbs
daysLeft = Math.floor(e_daysLeft);// Vbs
e_hrsLeft = (e_daysLeft - daysLeft)*24;// Vbs
hrsLeft = Math.floor(e_hrsLeft);// Vbs
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);// Vbs
document.write("there are only ... the days left will come after this " + daysLeft + " Days " + hrsLeft +" Hours " + minsLeft + " Minutes</H4> Until it is ... your reason of count down like my birthday or ... <P>"); 
// I started this from something I got from moonfruit.com Credits for them. 
</script>

That's how it would look like

[フレーム]


Thanks to tsangk for this great snippet: conditional-blocks


text above inserted with:

[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]



Other snippets posted by Massimo v


Rate this solution

If you think this solution is useful — rate it up!

rating: +25
danarra danarra 01 Mar 2020 14:31
<scripttype="text/javascript">
today = newDate();
BigDay = newDate("Month dayofmonth, year"); // Change date to the day you would like to countdown tomsPerDay = 24 * 60 * 60 * 1000 ; // VbstimeLeft = (BigDay.getTime() - today.getTime());// Vbse_daysLeft = timeLeft/ msPerDay;// Vbs
daysLeft = Math.floor(e_daysLeft);// Vbs
e_hrsLeft = (e_daysLeft - daysLeft)*24;// Vbs
hrsLeft = Math.floor(e_hrsLeft);// Vbs
minsLeft = Math.floor((e_hrsLeft - hrsLeft)*60);// Vbs
document.write("there are only ... the days left will come after this " + daysLeft + " Days " + hrsLeft +" Hours " + minsLeft + " Minutes</H4> Untilitis ... yourreasonofcountdownlikemybirthdayor ... <P>"); 
// I started this from something I got from moonfruit.com Credits for them. 
</script>
by danarra danarra , 01 Mar 2020 14:31
page revision: 1, last edited: 22 Dec 2014 08:31
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License
Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).

AltStyle によって変換されたページ (->オリジナル) /