Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Display a message box for a certain number of seconds

    As topic states ; how can I do this?
    Last edited by Pompiuses; 06-16-2004 at 08:58 AM.

  • #2
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Use setTimeout() method. Try this

    PHP Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <
    html>
    <
    head>
    <
    script>
    time=3000;//time to stay on, in milliseconds
    function closeMes(){
    document.getElementById('mes').style.display='none'
    }
    window.onload=function(){setTimeout('closeMes()',time)}
    </script>
    </head>
    <body>
    <div id="mes" style="position:absolute; background-color:#CCCCCC">This message will stay on for 3 seconds</div>
    </body>
    </html> 
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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