[dojo-contributors] dojo.fx.lite

Bryan Forbes bryan at reigndropsfall.net
Fri Apr 21 13:35:45 EDT 2006


> In lite/Animation.js, the curve object should be optional.  It'd be nice 
> to be able to pass in just start and end coordinates, and default to the 
> lite Line.  This seems a little heavy:
> anim = new dojo.fx.lite.Animation(handlers, duration,
>                 prop.curve||new dojo.fx.lite.Line(prop.start, prop.end),
>                 easing, prop.repeatCount, prop.rate);

That's a good idea.  I'll modify Animation to do that, since the lite 
Line is what most people are going to be using.

> In lite.js slideTo() seems too complicated a method for animating two 
> properties.  I think you'll find that people will end off creating an 
> animation for each property which is not ideal.

You're right.  I just changed it to be much simpler.

> I suggested to Alex the idea of extending the Animation object and have 
> an interface something like this:
> anim = new dojo.fx.lite.PropertyAnimation(node, [0, 0, 10, 200, 0], [50, 
> 50, 200, 200, 100], ['left', 'top', 'width', 'height', 'opacity'], 
> duration);
> 
> Or maybe:
>  PropertyAnimation(node, duration, easing, prop1, prop2, ..., propN)
> where propX is like you have:
> { property: "opacity", start: 0, end: 1 }

I like the second version better, but I would probably put the propX's 
into an array and move the duration and easing to the end of the 
function signature to make it easier to leave those as defaults, so:

PropertyAnimation(node, [prop1, prop2, ...], duration, easing)

> Then slideTo, resizeTo or colourFade functions become nearly as short as 
> wipeTo.

Yeah, that makes sense.  Thanks for the suggestions!



More information about the dojo-contributors mailing list