Results 1 to 6 of 6

Thread: Universal Countdown Script

  1. #1
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Universal Countdown Script

    1) Script Title:
    Universal Countdown Script

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...lcountdown.htm

    3) Describe problem:
    I'm trying to create a web page with 5 countdown
    but the target date is different for every div.
    i tryied changing only this part of the body for 2 different target but i can see only one countdown:
    Code:
    var launchdate=new cdLocalTime("cdcontainer", "server-php", 0, "April 23, 2010 15:53:00", "debugmode")
    launchdate.displaycountdown("days", formatresults2)
    var launchdate=new cdLocalTime("cdcontainer", "server-php", 0, "April 24, 2010 15:53:00", "debugmode")
    launchdate.displaycountdown("days", formatresults2)


    i know that i can use the code five times changing only the functions name but it will be too heavy for the site..
    do you know a better solution?
    thank you
    Last edited by jscheuer1; 01-07-2009 at 03:54 PM. Reason: proper formatting of code block

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    You'd have to change the name of the variable every time(see highlighted):
    Code:
    var launchdate0=new cdLocalTime("cdcontainer", "server-php", 0, "April 23, 2010 15:53:00", "debugmode")
    launchdate.displaycountdown("days", formatresults2),
    launchdate1=new cdLocalTime("cdcontainer", "server-php", 0, "April 24, 2010 15:53:00", "debugmode")
    launchdate.displaycountdown("days", formatresults2);
    Jeremy | jfein.net

  3. #3
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tryied with that code but it still doesn't work
    i can see not more than 1 countdown...

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    <div id="cdcontainer0">
    
    </div>
    
    <div id="cdcontainer1">
    
    </div>
    
    <script type="text/javascript">
    var launchdate0=new cdLocalTime("cdcontainer0", "server-php", 0, "April 23, 2010 15:53:00", "debugmode");
    launchdate0.displaycountdown("days", formatresults2);
    var launchdate1=new cdLocalTime("cdcontainer1", "server-php", 0, "April 24, 2010 15:53:00", "debugmode");
    launchdate1.displaycountdown("days", formatresults2);
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you very much
    you are the best

  6. #6
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Ahh - yes, if you don't see what John did. He also changed the container div of the clock - this is something I forgot to do.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •