A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mootools.net/docs/core/Fx/Fx.Morph below:

MooTools Core Documentation

Allows for the animation of multiple CSS properties at once, even by a simple CSS selector. Inherits methods, properties, options and events from Fx.

Extends:

Syntax:

var myFx = new Fx.Morph(element[, options]);

Arguments:

  1. element - (mixed) A string ID of the Element or an Element to apply the style transitions to.
  2. options - (object, optional) The Fx options object.

Returns:

Examples:

Multiple styles with start and end values using an object:

var myEffect = new Fx.Morph('myElement', {
    duration: 'long',
    transition: Fx.Transitions.Sine.easeOut
});

myEffect.start({
    'height': [10, 100], 
    'width': [900, 300]  
});

Multiple styles with the start value omitted will default to the current Element's value:

var myEffect = new Fx.Morph('myElement', {
    duration: 'short',
    transition: Fx.Transitions.Sine.easeOut
});

myEffect.start({
    'height': 100, 
    'width': 300   
});

Morphing one Element to match the CSS values within a CSS class. This is useful when separating the logic and styles:

var myEffect = new Fx.Morph('myElement', {
    duration: 1000,
    transition: Fx.Transitions.Sine.easeOut
});


myEffect.start('.myClassName');

Notes:

See Also:

Sets the Element's CSS properties to the specified values immediately.

Syntax:

myFx.set(to);

Arguments:

  1. properties - (mixed) Either an object of key/value pairs of CSS attributes to change or a string representing a CSS selector which can be found within the CSS of the page. If only one value is given for any CSS property, the transition will be from the current value of that property to the value given.

Returns:

Examples:

var myFx = new Fx.Morph('myElement').set({
    'height': 200,
    'width': 200,
    'background-color': '#f00',
    'opacity': 0
});
var myFx = new Fx.Morph('myElement').set('.myClass');

Executes a transition for any number of CSS properties in tandem.

Syntax:

myFx.start(properties);

Arguments:

  1. properties - (mixed) An object of key/value pairs of CSS attributes to change or a string representing a CSS selector which can be found within the CSS of the page. If only one value is given for any CSS property, the transition will be from the current value of that property to the value given.

Returns:

Examples:

var myEffects = new Fx.Morph('myElement', {duration: 1000, transition: Fx.Transitions.Sine.easeOut});

myEffects.start({
    'height': [10, 100],
    'width': [900, 300],
    'opacity': 0,
    'background-color': '#00f'
});

Notes:

see Element.Properties

Setter

Sets a default Fx.Morph instance for an Element.

Syntax:

el.set('morph'[, options]);

Arguments:

  1. options - (object, optional) The Fx.Morph options.

Returns:

Examples:

el.set('morph', {duration: 'long', transition: 'bounce:out'});
el.morph({height: 100, width: 100});

Getter

Gets the default Fx.Morph instance for the Element.

Syntax:

el.get('morph');

Arguments:

  1. property - (string) the Fx.Morph property argument.

Returns:

Examples:

el.set('morph', {duration: 'long', transition: 'bounce:out'});
el.morph({height: 100, width: 100});
el.get('morph'); 

Animates an Element given the properties passed in.

Syntax:

myElement.morph(properties);

Arguments:

  1. properties - (mixed) The CSS properties to animate. Can be either an object of CSS properties or a string representing a CSS selector. If only one value is given for any CSS property, the transition will be from the current value of that property to the value given.

Returns:

Example:

With an object:

$('myElement').morph({height: 100, width: 200});

With a selector:

$('myElement').morph('.class1');

See Also:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3