How to introduce delay for downloading ?

Discussion in 'HTML & Website Design' started by poseidon, Mar 5, 2006.

  1. #1
    Hi,

    I am having a page where I am going to put some links for a ebook, When the user click onthe links for downloading, he will be taken to another page probably with some ads,and than the download will start in 5 seconds ..How to do this..

    Thanks..
     
    poseidon, Mar 5, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In the page with the ads you would need to add a meta redirect as follows:

    
    <meta http-equiv="Refresh" content="10;url=http://www.domain.com/download.html">
    
    HTML:
    This will redirect to the specified url after 10 seconds.
     
    mad4, Mar 6, 2006 IP
    poseidon likes this.
  3. petarddd

    petarddd Peon

    Messages:
    132
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can use a simple javascript with setTimeout... You can put the download information and link in a DIV which is hidden by default. Then, you put a javascript on the body's onLoad event like this:

    <body ... onLoad="javascript: setTimeout('unhide()',5000)">

    and you have a script like this:

    <script>
    function unhide()
    {
    document.getElementById('theIDofTheDivWithDownloadInfoAndLink').style.display = 'block';
    }
    </script>

    and you div looks like this:

    <div id="theIDofTheDivWithDownloadInfoAndLink" style="display: none">
    download info and link
    </div>
     
    petarddd, Mar 6, 2006 IP
    poseidon likes this.