PDA

View Full Version : Dynamic Countdown script



babrees
10-04-2007, 05:39 PM
1) Script Title: Dynamic Countdown script

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

3) Describe problem: This script displays two countdowns. I have tried just about everything to have only the lower countdown display, but whatever change I make removes the whole lot!

Here it is on http://www.idealchristmasgift.co.uk/ Can somebody please tell me how to only display the second countdown.

Cheers

ddadmin
10-05-2007, 11:50 AM
Your page doesn't load right for me. In general though, to display just the 2nd countdown in the demo, the HTML would look like this:


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

<script type="text/javascript">

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)

</script>

babrees
10-05-2007, 01:07 PM
Your page doesn't load right for me. In general though, to display just the 2nd countdown in the demo, the HTML would look like this:



Thank you! I did try that but must've done a typo or something as it didn't work, but all is fine now.

You may have had a problem accessing as I was working on the site around the time you posted, so it may be that I was in the middle of moving the files around!