Jump to content

What is wrong?


Fire Dragon

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...