View Full Version : Countdown Script

12-08-2006, 01:54 PM
1) Script Title: Dynamic Countdown Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex6/dhtmlcount.htm

3) Describe problem: I want to know if I could make it so only the graphical countdown one shows. I do not want the text countdown to show. Could anyone help me out here?

12-10-2006, 05:42 AM
This from the demo page (Step 2):

<div id="countdowncontainer"></div>
<br />
<div id="countdowncontainer2"></div>

<script type="text/javascript">

var futuredate=new cdtime("countdowncontainer", "March 23, 2009 18:25:00")
futuredate.displaycountdown("days", formatresults)

var currentyear=new Date().getFullYear()
//dynamically get this Christmas' year value. If Christmas already passed, then year=current year+1
var thischristmasyear=(new Date().getMonth()>=11 && new Date().getDate()>25)? currentyear+1 : currentyear
var christmas=new cdtime("countdowncontainer2", "December 25, "+thischristmasyear+" 0:0:00")
christmas.displaycountdown("days", formatresults2)


contains two calls to the main script preceded by their respective containers. One set is in green, the other in red. If you want only one, pick the one you want, edit it to your desired date and get rid of the other one.

To answer your question another way, just use the 'formatresults2' version.