var anim = new dojo.animation.Animation(
// linear points from (0,0) to (400,200)
new dojo.math.curves.Line([0,0], [400,200]),
1. , // do it over a 3 second duration
2. // with no acceleration
);
dojo.event.connect(anim, "onAnimate", function(e) {
node.style.left = e.x + "px";
node.style.top = e.y + "px";
});
dojo.event.connect(anim, "onBegin", function(e) {
var div = document.createElement("div");
div.appendChild(document.createTextNode("Animation started!"));
document.body.appendChild(div);
});
dojo.event.connect(anim, "onEnd", function(e) {
var div = document.createElement("div");
div.appendChild(document.createTextNode("Animation done!"));
document.body.appendChild(div);
});
anim.play();