Download link to appear after 10 seconds

by 7 replies
9
I am sending subscribers to my download page which has download link plus other ads.

I want the download link to appear after say 10 seconds. Does anyone knows how to do that.

Thanks in advance.
#programming #download #link #seconds
  • I actually was looking for this kind of information a few weeks ago and I bookmarked this (I have no affiliation with the site):

    jsfiddle.net/rATW7/

    It will show a label that features a countdown from 10 to zero and then shows a link for download. If you don't want to show countdown you can easily replace that label value with the value you like!
  • Thanks. I will check now how it works.

    I am not good at programming but I guess I have to include html, css and javascript all on the same page.
  • If you are using WordPress, the Optimize Press theme will do this on any page. Otherwise Mark Hendricks has a script that is easy to use at Presto Chango - Mark Hendricks
    • [ 1 ] Thanks
  • Thanks Chris,

    I will check Mark Hendricks script.
  • It seems that I can't post pm's yet so I'll put this here. First of all it's best to keep the script within HEAD tags. Change <script> into this:
    <script type="text/javascript">.

    If this doesn't fix the problem I'll investigate a little more
  • I moved the script to HEAD tags but same result. Thanks for your help.
  • Make this little script. Should do what you want. Just change

    1) the line with download.html to the any file or page you want
    2) the body onload line set the 10 to any amount of seconds you want your visitor to wait

    And that's it. Try and see for yourself.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Javascript to Countdown</title>
    <script type="text/javascript">
    function countseconds(countdn, dl)
    {
        //alert('ok! s= ' +countdn+ ' dl= ' +dl);
        if (countdn < 0)
            document.getElementById(dl).innerHTML = "<a href='download-page.html'>Download</a>";
        else
        {
            document.getElementById(dl).innerHTML = countdn+ " seconds remain...";
            setTimeout( 'countseconds('+(countdn-1)+',\''+dl+'\');', 1000 );
        }
    }
    </script>
    
    </head>
    <body onload='countseconds("10", "download");'>
    
    <span id="download">Processing</span> 
    
    <br />
    
    <a href='countdown.html'>Clear</a>
    
    </body>
    </html>
    - Rufas

Next Topics on Trending Feed