SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Countdown script

    Hello,

    Im looking for two types of countdown script that will count from 10 to 0
    One being a image based (now i dont know which method is best, ajax? siFR based?)
    So meaning images of the numbers appear and change appropriately.

    and one non basic one.

    Most scripts are date based i dont require a date based one.

    Can anyone give me some pointers?

    Ben

  2. #2
    Google Engineer polvero's Avatar
    Join Date
    Oct 2003
    Location
    Mountain View
    Posts
    567
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <div id="counter">10</div>
    <script>
    var counter = document.getElementById('counter');
    var num = 10;
    window.setTimeout(function() {
      counter.innerHTML = --num;
    }, 1000);
    image based
    Code:
    <div id="counter">10</div>
    <script>
    var counter = document.getElementById('counter');
    var num = 10;
    window.setTimeout(function() {
      // include 10.jpg, 9.jpg, 8.jpg, etc...
      counter.innerHTML = '<img src="' + --num + '.jpg" />';
    }, 1000);


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
  •