Have you tried to load this file into a browser?
The code works fine. However, this code should not make up a "page" but should be a "part" of a page. For example, let's say I wanted to include this code on an About page. Previously when I've created a swf file in Flash, I would place the swf on the part of the page I want it to appear. In the case of html 5 canvas output there is no single "container" file like a swf. So I want to know where the different parts should go.
1 person found this helpful
All of the sections marked with the <script> tags should go in the head of the About page. From this line: <body onload="init();" style="background-color:#D4D4D4">, you want to take the onload="init();" part and add it to the <body> tag of the About page. You can also add the background color if you want.
The part marked with the <canvas> tag is the part that need to be added to the body of the About page. I don't know what your About page contains, so I can't tell you where it should be placed.
I'd like to mark you answer as correct but nothing appears in the "actions" panel. It just says "No actions are available." I've had "Mark as Correct" appear at times, but I don't how or why. It seems that it appears randomly.
I don't really like this new forum. The previous version was better.
What if I'm working with a blog template where the <head> and <body> are only provided in the template and not the actual blog post HTML? I tried changing the <body> tag to a <div> but the animation did not initialize.
Here is a link to the post, How to Make Your Kids Smarter.
That link doesn't help me much, I just get to see the result of the parts after they're put together, probably by a php script. In any case, you should be able to place the pieces that go in the head into the head section. You will probably have to set up or change the path to the local file since the head section is probably in a folder. The part that goes into the body section should work as it is.