Morph using CSS class selector

21 views
Skip to first unread message

Alexey Uimanov

unread,
Jan 10, 2012, 5:46:52 AM1/10/12
to rig...@googlegroups.com
Hello. Is there some way to obtain style for given class?
Something like that:
new Fx.Morph(element).start(getStyle('.some-class'));

Just like MooTools can:
Fx.Morph(element).start('.some-class');

Nikolay Nemshilov

unread,
Jan 10, 2012, 6:13:27 AM1/10/12
to rig...@googlegroups.com
Привет,

Not really. You can try to hack it around by using Element#computedStyles() but it might get tricky because some styles might get stuck in the "style" property and override CSS if the element change its context.

Much better solution would be to define CSS3 transitions in your CSS classes and then simply add them with Element#addClass. That won't make a smooth transition in old IE browsers, but it will be a less error prone approach. Besides that will be much simpler to support.

Alexey Uimanov

unread,
Jan 10, 2012, 7:00:56 AM1/10/12
to rig...@googlegroups.com
Thanks! this is realy cool! but need installed modern browser.

Nikolay Nemshilov

unread,
Jan 10, 2012, 7:33:42 AM1/10/12
to rig...@googlegroups.com
Yes, but it's a good thing actually. It falls back gracefully and makes the user wanting to upgrade to a modern browser :)
Reply all
Reply to author
Forward
0 new messages