Fire Dragon Posted February 2, 2006 Share Posted February 2, 2006 I made timer,using code from w3schools' example,but it won't work with my game.Here is code what I try get work: <script type="text/javascript">var t=setTimeout("document.getElementById('ritari1').style.display="block";",1000)</script> As you can see,I want that image,what's ID is "ritari1" comes visible,when time is over.ID code is right,because I tested it without timer,and it works nicely.But when I put ID and timer code together,nothing happens.And timer works nicely alone too.Did I write something wrong? Link to comment Share on other sites More sharing options...
aspnetguy Posted February 2, 2006 Share Posted February 2, 2006 try this <script type="text/javascript">var t=setTimeout("document.getElementById('ritari1').style.display='block';",1000)</script> You cannot use (") inside of (") the timer thought the end of the code to run was display= and then didn't find a number after that so it choked. Link to comment Share on other sites More sharing options...
Fire Dragon Posted February 2, 2006 Author Share Posted February 2, 2006 Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now