6 description: Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules.
8 license: MIT-style license.
17 Fx.Morph = new Class({
21 initialize: function(element, options){
22 this.element = this.subject = document.id(element);
27 if (typeof now == 'string') now = this.search(now);
28 for (var p in now) this.render(this.element, p, now[p], this.options.unit);
32 compute: function(from, to, delta){
34 for (var p in from) now[p] = this.parent(from[p], to[p], delta);
38 start: function(properties){
39 if (!this.check(properties)) return this;
40 if (typeof properties == 'string') properties = this.search(properties);
41 var from = {}, to = {};
42 for (var p in properties){
43 var parsed = this.prepare(this.element, p, properties[p]);
44 from[p] = parsed.from;
47 return this.parent(from, to);
52 Element.Properties.morph = {
54 set: function(options){
55 this.get('morph').cancel().setOptions(options);
60 var morph = this.retrieve('morph');
62 morph = new Fx.Morph(this, {link: 'cancel'});
63 this.store('morph', morph);
72 morph: function(props){
73 this.get('morph').start(props);