Inheritance through Prototypes: The Simple Animation Code - www.docjavascript.com | WebReference

Inheritance through Prototypes: The Simple Animation Code - www.docjavascript.com


The Code and HTML for the Simple Animation

<DIV ID="ball1" STYLE="position: absolute; left: 200; top: 200; width: 50;">
<IMG SRC="ball1.gif" WIDTH="50" HEIGHT="50"></DIV>
<DIV ID="ball2" STYLE="position: absolute; left: 350; top: 480; width: 25;">
<IMG SRC="ball2.gif" WIDTH="25" HEIGHT="25"></DIV>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
document.write("<SCRIPT SRC='animate.js'></SCRIPT>");
onload = start;
function start() {
  anim1 = new animation_simple("ball1");
  if (!anim1.element) return;
  anim2 = new animation_simple("ball2");
  myArray = new Array();
  myArray[0] = "anim1.circle(100, 0, -60, 0, 3, 50, 'myArray')";
  myArray[1] = "anim2.circle(100, 30, 30, 2, 5, 25, 'myArray')";
  myArray[2] = "anim1.circle(100, 0, -60, 0, 3, 50, 'myArray')";
  anim2.slideBy(200, -300, 10, 50, "myArray");
}
// -->
</SCRIPT>

http://www.internet.com

Produced by Yehuda Shiran and Tomer Shiran

Created: January 18, 1999
Revised: January 18, 1999

URL: http://www.webreference.com/js/column34/code1.html