Example - JavaScript animations - canvas based. I am having a "ball" playing around with this task! Obviously a man with way too much time on his hands :).
This stuff is totally contageous - Below are a sequence of links that take you through the dev process. Promise that this is the end of it
bouncing-1.html