If you are a first-year beginner, good work. Keep it up. If not, well, you might have some studying to do.
And from the code, it's what it's supposed to do. It's a convincing effect unless you pay attention to the details.
This works well (with a slight stutter) in Firefox 15.