I’ve decided to post all the silly little things that I do and the resolutions to them.
If you’re coming across something like “A is Null” in MooTools – specifically MooTools Morph – make sure that you’re not passing a collection of elements.
For example, $$(’#element_identifier’), whilst only returning one element, will actually return a collection (albeit a collection containing one element!).
The solution is either use
var y = $$('#element_identifier'); var eldMorph = new Fx.Morph(y[0]);
Or use:
var eldMorph = new Fx.Morph($('element_identifier'));
As the single-dollar only returns one element, not a collection of elements.
While these things are obvious, for those who are playing around at the weekend or after work, it can be really frustrating if the answer isn’t a simple Google away.
No Comments on "MooTools Morph “A is Null”"