I am looking into how to create a simple animation in an HTML5 app. I want to start with an off-page canvas (with top set to 100% of the window height), and animate it to the middle of the screen, above my other canvases.
I have tried Google, but the search results are a mix of animating divs and animation within a canvas, and nothing I have attempted seem to work. For example, the jQuery animate() function, as discussed here.
I have also tried to dynamically create a canvas and animate it on screen, but that did not work. My current code is as follows:
HTML
<div id="view-addUser" >
<canvas id="view-canvas"></canvas>
</div>
CSS
#view-addUser
{
left: 25%;
top: 100%;
width: 75%;
height: 75%;
}
javaScript (this is called when a button is pressed)
$("#view-addUser").animate({
top: 100
}, 3000, function() {
alert("animation complete");
});
How can I correctly get this to animate? The final result should be something like the up-direction of this MoonBase animation.