Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News moo.fx 2.0 released with Fx.Style while Animator.js avoids inheritance

moo.fx 2.0 released with Fx.Style while Animator.js avoids inheritance

moo.fx 2.0 has been released featuring new effects to modify any CSS property, the color properties of elements, and to internally scroll long divs. An interesting alternative not using inheritance but providing similar functionality is the Animator.js library.  moo.fx and Animator.js are both JavaScript effects frameworks designed for speed, robustness, and small size.  moo.fx provides a number of demos on their mootools wiki. moo.fx is available as part of mootools or separately for use with prototype. This new release incorporates significant architectural changes to moo.fx and existing scripts are not guaranteed to work with it. moo.fx is described as:

moo.fx is a superlightweight, ultratiny, megasmall javascript effects library, to be used with prototype.js or the mootools framework.

It's very easy to use, blazing fast, cross-browser, standards compliant, provides controls to modify any CSS property of any HTML element, including colors, with builtin checks that won't let a user break the effect with multiple, crazy clicks. Optimized to make you write the lesser code possible, the new moo.fx is so modular you can create any kind of effect with it.

Bernie Sumption introduces Animator as an easy-to-use animation class with a small file size that uses composition and parameterization instead of inheritance. It was written as an alternative to moo.fx and because Sumption felt strongly about the decision to use inheritance:

In particular, they don't seem to realise that inheritance is evil, and must be destroyed. By providing base classes for an effect and requiring users to subclass it to make new effects, they create a proliferation of classes and make it too hard to create new effects that the library designer hasn't thought of (scriptaculous gets round this by thinking of every effect you might want, which is why it is so large).

In a comment on Ajaxian he mentions that he doesn't consider inheritance to be always evil, just overused in JavaScript. Currently Animator.js depends upon prototype, but he is considering lifting that restriction.

Rate this Article