html - javascript : simple delayed image show -
i'm trying write simple javascript snippet delays image loading number of millisecs below.
<html> <head> <script type="text/javascript"> function settimer() { var timer = setinterval("showimage()",3000); } function showimage() { document.getelementbyid('showimage').style.visibility = 'visible'; } </script> </head> <body onload="settimer()" style="visibility:hidden"> <div id=showimage> <a href="home.php"><img src="gwyneth_paltrow_2.jpg"></a> </div> </body> </html>
am approaching incorrectly?
thanks in advance
this ok approach. there bugs, namely:
document.getelementbyid('showimage')style.visibility = 'hidden';
getelementbyid
should getelementbyid
needs dot after ('showimage')
you setting visibility 'hidden' in order show it. instead, should start out hidden, , make appear instead of disappear.
Comments
Post a Comment