www.webdeveloper.com
Results 1 to 4 of 4

Thread: temporary messages

  1. #1
    Join Date
    Sep 2005
    Posts
    2

    temporary messages

    I'm not quite sure what forum this question should go in, so I'm just posting it here. I want a message on my site to only be displayed for about 10 seconds. How would I do this? Thanks.

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    JavaScript:[code]onload=timerID=setTimeout('deleteMessage()',10000);
    function deleteMessage() {
    document.getElementById('message').style.display='none';
    clearTimeout(timerID);
    }
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Sep 2005
    Posts
    2
    ok, thanks for that. I'm kinda new to js, so if I wanted to say "message 1" for 10 seconds, how would I do that and where would I put it.

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <title>timer</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    
    <script type="text/javascript">
    <!--
    onload=timerID=setTimeout('deleteMessage()',10000);
    function deleteMessage() {
    document.getElementById('message').style.display='none';
    clearTimeout(timerID);
    }
    //-->
    </script>
    
    </head>
    <body>
    <h1 id="message">message 1</h1>
    </body>
    </html>
    At least 98% of internet users' DNA is identical to that of chimpanzees

Thread Information

Users Browsing this Thread

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

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