I am using Mootools 1.3.1 and I want to animate a div with fx.morph but in the browser debug console I get
TypeError: Result of expression 'c' [null] is not an object.#
mootools-core-1.3.1.js:394
I built not the mootools script but I have to add some more animations and functions with mootools using this version.
My script looks like this:
var myEffect = new Fx.Morph("div.tile", {
duration: 'short',
transition: Fx.Transitions.Sine.easeOut
});
myEffect.start({
'height': 100, // Morphs the height from the current to 100px.
'width': 300 // Morphs the width from the current to 300px.
});
the doc:
http://mootools.net/docs/core/Fx/Fx.Morph
the first parameter for the morph method is an “element” (object) or the id of the element, you’re passing a selector.. so “div.tile” wont work.
you’ll need to add an id to your element or use the
each()method to give the effect to all the elements with the class “tile”Test example: http://jsfiddle.net/AGVwh/ (tested on Mootools 1.2.5 and 1.3.2, so it should also work on 1.3.1)
Hope this helps