www.webdeveloper.com
Results 1 to 4 of 4

Thread: Need Button Help!

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Posts
    4

    Need Button Help!

    SO I want to make a clickable button appear on my page within a few amount of seconds.

    Say like 10 seconds. Then once 10 seconds is up the button appears and the person can click continue.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    
    <script type="text/javascript">
    window.onload=function() {
    var delayed = document.getElementById('delayed');
    delayed.style.visibility = 'hidden';
    window.setTimeout(function(){delayed.style.visibility = 'visible';}, 2000); // 2sec
    };
    </script>
    
    <style type="text/css">
    body {
    font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-size:0.8em;
    }
    </style>
    
    </head>
    <body>
    <button type="submit" id="delayed">submit</button>
    </body>
    </html>
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Mar 2011
    Posts
    4
    nice thanks! say i want to have a link pop up to another page to my site is that possible?

  4. #4
    Join Date
    Apr 2011
    Location
    Okinawa, Japan
    Posts
    18
    Change the id "delayed" from a button to whole DIV. Reinsert the button and then drop a <a> tag in there.

    Code:
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    
    <script type="text/javascript">
    window.onload=function() {
    var delayed = document.getElementById('delayed');
    delayed.style.visibility = 'hidden';
    window.setTimeout(function(){delayed.style.visibility = 'visible';}, 2000); // 2sec
    };
    </script>
    
    <style type="text/css">
    body {
    font-family:Verdana, Geneva, Arial, Helvetica, sans-serif;
    font-size:0.8em;
    }
    </style>
    
    </head>
    <body>
        <div id="delayed">
        <button type="submit">submit</button>
        <a href="wherever.com">Click</a>
        </div></body>
    </html>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles