Class: Cmorph
Animates any number of properties on any object.
Extends
Cmorph Method: constructor
Syntax
new Cmorph( item, object );
Arguments
- item - (object) The object to which the animations are applied.
- options - (object) Fx.options
Returns
- (object) - this (Cmorph instance)
Notes
Cmorph does not work synchron with Thread or even the draw-event of an item. An item's properties will be modified regardless of whether the item is currently rendered or even visible at all.
At the moment, chaining will not work as expected.
Cmorph Method: morph
Syntax
cmorph.morph( object );
Arguments
- properties - (object) The properties of the object that you want to animate.
Returns
- (object) - this (Cmorph instance)
Notes
Each value can either be a number which describes the end-value of the animation or an array with the start and end-value of each property. If only a number is given Cmorph will attempt to retrieve the start-value from the current state of the object.
Example
var obj = { a : 0, b : 0 };
new Cmorph(obj,{
duration : 500
}).morph({
a : 100, //will go from 0 to 100
b : [100,200] //will go from 100 to 200
});