How To Create A countdown

32 replies
Can someone please show me how to create a simple countdown for one of my landing pages...

What I'm trying to do is make a number like 102.3 (seconds.milliseconds) countdown to zero. I want it to start over for every visitor.

Just looking for regular text.. Nothing fancy..

I've been trying to find this script for a long time now (on and off a year) but can't come across what I need; not even with Google..

If it's some type of secret industry script, please email me about it..

I greatly appreciate it..
#countdown #create #script
  • Profile picture of the author Brandon Tanner
    What you're looking for is a Javascript countdown timer. If you Google it you'll find tons of choices and code examples.

    FYI, a tenth of a second (as in your example) is called a decisecond. A millisecond would be like 102.3000, which would be extremely processor-intensive to count down and would probably crash most (if not all) of your visitor's browsers.

    I would just use seconds if I were you. Any greater resolution than that, and you start risking potential browser/display issues with your visitors who are on slower connections.
    Signature

    {{ DiscussionBoard.errors[6195592].message }}
    • Profile picture of the author webpeon
      Originally Posted by Brandon Tanner View Post

      FYI, a tenth of a second (as in your example) is called a decisecond.
      Looks like I learnt something new today, its interesting I just learnt the other day that "jiffy" is actually a measurement as well, not just the slang ive always thought it to be.
      Signature
      Web 2 Mobile
      The Future of The Web
      {{ DiscussionBoard.errors[6209444].message }}
  • Profile picture of the author Dennisknows
    Learn something new everyday. I've done tons of searches but I don't think I searched for that exactly..

    Thanks Brandon..

    I'll get on it...
    Signature
    "May the optimism of your tomorrow fuel your drive for today"
    {{ DiscussionBoard.errors[6195748].message }}
  • Profile picture of the author dbwebdesignz
    Javascript can do this, it will reset every time a user refreshes the page though
    Signature
    Lets Us Do Your Back linking >>> The Best SENuke X Campaign <<< Panda and Penguin friendly

    Cheap Web Hosting £2.49 per month
    London Website Design
    {{ DiscussionBoard.errors[6196269].message }}
  • Profile picture of the author lordspace
    Hi Dennis,

    have you checked this: jQuery Plugin: jQuery Countdown
    Signature

    Are you using WordPress? Have you tried qSandbox yet?

    {{ DiscussionBoard.errors[6204409].message }}
  • Profile picture of the author TheApex
    Hello,

    I made a small javascript snippet, that may do what you want... or at least what I understand you want
    However it may "force" the browser a bit, but it should be fine.

    HTML Code:
    <script>
    milliseconds = 200 * 1000;  //countdown length
    
    first = new Date().getTime();     
    function start_cd()
    {
         now = new Date().getTime() - first;
         document.getElementById('timer').innerHTML = Math.round((milliseconds - now)/1000*1000)/1000;
        
         if (milliseconds - now > 0)
                 setTimeout("start_cd()", 1);
    
         
    }
    </script>
    
    <body onLoad="start_cd();">
    <div id="timer">
    </div>
    </body>
    {{ DiscussionBoard.errors[6211502].message }}
  • Profile picture of the author brandonthomas
    Banned
    In order to create a countdown timer in JavaScript you'll have to use the window.setTimeout function which will call a JavaScript function after a certain amount of time.
    {{ DiscussionBoard.errors[6223565].message }}
  • Javascript count doen is the best solution. you can create very attractive ones.
    Signature
    {{ DiscussionBoard.errors[6227594].message }}
    • Profile picture of the author Dennisknows
      Originally Posted by ivankristianto View Post

      Give me your email, then i can email you my wordpress plugin for countdown.
      Ok.. Sending you a pm and a friend request now.. Thanks

      Originally Posted by System Wide Solutions View Post

      Javascript count doen is the best solution. you can create very attractive ones.
      I guess I need to study JavaScript because I see that it is very valuable to Internet marketing. What's a good way to get started in learning JavaScript if anyone knows any
      Signature
      "May the optimism of your tomorrow fuel your drive for today"
      {{ DiscussionBoard.errors[6234936].message }}
      • Profile picture of the author Brandon Tanner
        Originally Posted by Dennisknows View Post

        I guess I need to study JavaScript because I see that it is very valuable to Internet marketing. What's a good way to get started in learning JavaScript if anyone knows any
        Yeah... Javascript is pretty cool. Just keep in mind that a small percentage (~ 1-2%) of your website visitors will have JS disabled in their browser, so you don't want to rely on JS for anything that is "mission critical". But for all other uses, it's fine.

        That said, I think Tizag has excellent tutorials for beginners...

        Javascript Tutorial - Intro

        W3Schools also has good tutorials...

        JavaScript Tutorial
        Signature

        {{ DiscussionBoard.errors[6235381].message }}
      • Profile picture of the author ivankristianto
        Hi Dennis,
        since i cannot send pm (because my post is not 50 yet).
        can you send me your email instead?
        i will send it to your email.

        Originally Posted by Dennisknows View Post

        Ok.. Sending you a pm and a friend request now.. Thanks



        I guess I need to study JavaScript because I see that it is very valuable to Internet marketing. What's a good way to get started in learning JavaScript if anyone knows any
        {{ DiscussionBoard.errors[6246338].message }}
  • Profile picture of the author ivankristianto
    Give me your email, then i can email you my wordpress plugin for countdown.
    {{ DiscussionBoard.errors[6234274].message }}
  • Profile picture of the author shantanu
    Easy way to get rid of this **** >> MAKE YOUR OWN COUNTER

    Alternative Solution To This Problem
    {{ DiscussionBoard.errors[6250753].message }}
  • Profile picture of the author designdon
    You can either use flash or php to make count down, according to me flash countdown is better
    {{ DiscussionBoard.errors[6252065].message }}
  • Profile picture of the author jewelraz
    I will try with this keyword "Javascript countdown timer", I was also thinking about it.... I might need it if I move my site to another server.
    {{ DiscussionBoard.errors[6255279].message }}
  • Profile picture of the author jaasmit
    To create a countdown on your landing page then you have to do it with javascript and to do that you need to have proper knowledge and skill about programming language.
    {{ DiscussionBoard.errors[6656862].message }}
  • Profile picture of the author oknoorap
    do you familiar with jQuery framework?, if you familiar then PM me (sorry but, I can't sit down everyday in front of my laptop)
    {{ DiscussionBoard.errors[6670331].message }}
  • Profile picture of the author antac
    Banned
    Can you put PHP or java on your site? If you can use java then try that. It should be real easy to make one that is constantly ticking down. Also, you can probably make one in flash. I know for a fact you could do one in PHP but it wouldn't tick down constantly, only when the page was refreshed. Try searching google for a premade one.
    {{ DiscussionBoard.errors[6678058].message }}
  • Are you looking for something like this:

    LaunchSoon Demo
    Signature
    WebDevelopmentGroup NYC & CA- Small Business Web Development, App Development, WordPress Development, Graphic Designs, Online Marketing, Local Marketing & more!. "Call us 1.800.219.1314 or message us!". Visit us today! "Now On Live Chat Mon-Fri.". www.WebDevelopmentGroup.org
    (Whitelable our Services)
    ===================================
    ==> #1 OFFLINE MARKETING FORUM ON THE WEB! <==
    www.OFFLINEMARKETINGFORUM.com
    (Register Now)
    {{ DiscussionBoard.errors[6680089].message }}
  • Profile picture of the author mmrumii
    Here i have shared a link where you can find your solution.
    you can create countdown by using javascript.

    http://www.google.com/url?sa=t&rct=j...hObk6vsTfjky0w
    {{ DiscussionBoard.errors[6681221].message }}
  • Profile picture of the author ubaid12j
    Use the following code.

    Code:
    <script language="JavaScript">
    
    //Refresh page script- By Brett Taylor (glutnix@yahoo.com.au)
    //Modified by Dynamic Drive for NS4, NS6+
    //Visit http://www.dynamicdrive.com for this script
    
    //configure refresh interval (in seconds)
    var countDownInterval=60;
    //configure width of displayed text, in px (applicable only in NS4)
    var c_reloadwidth=200
    
    </script>
    
    
    <ilayer id="c_reload" width=&{c_reloadwidth}; ><layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer></ilayer>
    
    <script>
    
    var countDownTime=countDownInterval+1;
    function countDown(){
    countDownTime--;
    if (countDownTime <=0){
    countDownTime=countDownInterval;
    clearTimeout(counter)
    window.location.reload()
    return
    }
    if (document.all) //if IE 4+
    document.all.countDownText.innerText = countDownTime+" ";
    else if (document.getElementById) //else if NS6+
    document.getElementById("countDownText").innerHTML=countDownTime+" "
    else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
    document.c_reload.document.c_reload2.document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
    document.c_reload.document.c_reload2.document.close()
    }
    counter=setTimeout("countDown()", 1000);
    }
    
    function startit(){
    if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
    document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
    countDown()
    }
    
    if (document.all||document.getElementById)
    startit()
    else
    window.onload=startit
    
    </script>
    {{ DiscussionBoard.errors[6688068].message }}
    • Profile picture of the author markmotts
      Hey Gang - Do you know of a countdown timer solution that will work within a WSO post?
      Signature
      {{ DiscussionBoard.errors[6792011].message }}
      • Profile picture of the author Brandon Tanner
        Originally Posted by markmotts View Post

        Hey Gang - Do you know of a countdown timer solution that will work within a WSO post?
        Not possible, as you can't insert (working) HTML or Javascript into WF posts.
        Signature

        {{ DiscussionBoard.errors[6793400].message }}

Trending Topics