Snippet, sprite animation of JavaScript