Search code examples
javascriptcountercountdown

More than 1 countdown timer on page


I'm trying to add more than one countdown timer with the same date on my page. For some reason the second one doesn't work. I found this countdown code and would see if anyone had a suggestion for me.

JS:

<script language="JavaScript"> 
  TargetDate = "10/31/2011";
BackColor = "none";
ForeColor = "none";
CountActive = true;
CountStepper = -1;
LeadingZero = false;
      DisplayFormat = "<br><strong><span style='color:red;font-size:20px;' id='phrase1'>%%D%%</span> Days, <span style='color:red;font-size:20px;'>%%H%%</span> Hours, <span style='color:green;font-size:20px;'>%%M%%</span> Minutes & <span style='color:green;font-size:20px;' id='seconds'>%%S%%</span> Seconds Until <span style='color:blue;font-size:22px;'>Halloween</span><span style='color:black;'>!</span></strong>" ;
      FinishMessage = "<b><span style='color:red;font-size:22px;'>Happy Halloween</span><span style='color:blue;'>!</span></b>";
</script> 
<script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"> 

I hope someone can help me with this....or can give me a new countdown code
Thanks,
Shawn.


Solution

  • This particular one you cant use twice since all variables etc are in a global scope.