Ajax Layer JavaScript DHTML

http://dynapi.sourceforge.net/
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999


DynAPI Examples - Glide Animation (Path Animation)


dynapi.library.setPath('./dynapisrc/');
dynapi.library.include('dynapi.api');
dynapi.library.include('dynapi.debug');
dynapi.library.include('PathAnimation');
dynapi.library.include('GlideAnimation');


DynAPI.onLoad(init);
function init() {
  block = new DynLayer();
  block.setSize(20,20);
  block.setLocation(200,100);
  block.setBgColor("red");
  squarePath = new PathAnimation(block);
  squarePath.sleep(20);
  var p = GlideAnimation(200,100,400,100,7,'slow','slow');
  p = p.concat( GlideAnimation(400,100,400,200,7,'slow','slow') );
  p = p.concat( GlideAnimation(400,200,200,200,7,'slow','slow') );
  p = p.concat( GlideAnimation(200,200,200,100,7,'slow','slow') );
  squarePath.add(p,true);
  var listener = {}
  listener.onpathstart = function(e) {
    DynAPI.debug.print("start");
  }
  listener.onpathrun = function(e) {
    var o = e.getSource();
    DynAPI.debug.print("play "+o.x+" "+o.y);
  }
  listener.onpathfinish = function(e) {
    var o = e.getSource();
    DynAPI.debug.print("stop "+o.x+" "+o.y);
  }
  block.addEventListener(listener);
  dynapi.document.addChild(block);
}
//-->



Square Slide:

start

pause

SlideTo:

(200,100) slow,slow

(400,100) slow,slow

(400,200) slow,slow

(200,200) slow,slow

(100,100) fast,slow

(50,400) slow,fast

(0,0) fast fast


           
       
dynapi.zip( 791 k)