...

View Full Version : Display a message box for a certain number of seconds



Pompiuses
06-16-2004, 08:54 AM
As topic states ; how can I do this?

Kor
06-16-2004, 09:45 AM
Use setTimeout() method. Try this



<!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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum