Hi all,
I'm hoping to add some Javascript to a Plain Text page (hoping to achieve the function of the Bullets page, but with more control) so that text within div tags appear after 3, 6 and 9 seconds.
No, matter where I place the code (as HTML source on the page, or within the Script text box, or split the HTML and Script appropriately on the page) nothing seems to work. However when previewing this code in DreamWeaver it works OK.
Can someone help get this working for me please.
Here's my code...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>testdoc</title>
<script>
function showText(id,delay){
var elem=document.getElementById(id);
setTimeout(function(){elem.style.visibility='visible';},delay*1000)
}
window.onload=function(){
showText('delayedText1',3);
showText('delayedText2',6);
showText('delayedText3',9);
}
</script>
</head>
<body>
<div id="delayedText1" style="visibility:hidden">this is 3 seconden</div>
<div id="delayedText2" style="visibility:hidden">this is 6 seconden</div>
<div id="delayedText3" style="visibility:hidden">this is 9 seconden</div>
</body>
</html>
Thanks
Lewis