Assignments

Create an example solution for an animation similar to example 2, but make the motion vertical instead of horizontal.

Create an animated (small) image that moves 2-dimensionally around inside a bordered div on the screen. When it hits a border it should bounce off it. The following bit of sample code reveals essential information, the width and height of a div as js variables. Insert your own values into the style of the div:

<div id="tester11" 
        style="width:  100px; height: 100px; border: 1px solid black;"></div>
<script>     
  alert(document.getElementById('tester11').style.width+
        ":"+
        document.getElementById('tester11').style.height);
</script>