1.  
  2. var attributes = { points: { from: [ fromPos.left, fromPos.top], to: [toPos.left, toPos.top] }};
  3. anim = new YAHOO.util.Motion(thingToDrag.id, attributes, 1);
  4. anim.onTween.subscribe(handleTween);
  5. anim.onComplete.subscribe(handleComplete);
  6. anim.animate();
  7.  
  8.