Web Analytics Made Easy -
StatCounter After 30 seconds click link - CodingForum

Announcement

Collapse
No announcement yet.

After 30 seconds click link

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • After 30 seconds click link

    i need a code that after 30 seconds a link is avalable





    Like this:


    30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 Click here

    (before the 30 seconds is up tghe link is not clickable)

  • #2
    Hi there hiddenbox,

    have a look at this example, it may suit your requirements...
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>delayed link</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <style type="text/css">
    <!--
    .stop {
        color:#f00;
     }
    .go {
        color:#0f0;
     }
    -->
    </style>
    
    <script type="text/javascript">
    <!--
       var count=30;
       var obj;
    window.onload=function() {
       obj=document.getElementById('delayed');
       obj.onclick=function() {
    if(count<=0) {
       return true;
     }
    else {
    if(count==30) {
       waitForIt();
       return false;
     }
    else {
       return false;
        }
       }
      }
     }
    function waitForIt() {
       obj.firstChild.data='this link to google will be available after '+count+'secs';
    if(count<=0) {
       clearTimeout(cd);
       obj.firstChild.data='this link to google is now available';
       obj.className='go';
       return;
     }
       count--;
       cd=setTimeout('waitForIt()',1000);
     }
    //-->
    </script>
    
    </head>
    <body>
    
    <div>
    <a id="delayed" class="stop" href="http://www.google.com">this link to google will be available after 30secs</a>
    </div>
    
    </body>
    </html>
    coothead
    ~ the original bald headed old fart ~

    Comment

    Working...
    X