Bob Bedford wrote:
Hi all,
I've created a DIV with important notes for my site. I've a Close button
on it, but would like to have a timer that automatically close the div is
it hasn't been closed after a few seconds (let's say 5 seconds). Thanks
for your help.
How to do so ?
Hi
Use setTimeout();
eg:
<div id="helpdiv" style="display:block">
helpstuff here
</div>
<script type="text/javascript">
// close the div in 5 secs
window.setTimeout("closeHelpDiv();", 5000);
function closeHelpDiv(){
document.getElementById("helpdiv").style.display=" none";
}
</script>
Regards,
Erwin Moller