Sergio Panagia

Image Tween with Element.crossfade for MooTools

Element.crossfade is a MooTools extension to simulate a tween for background-image element’s property.

The syntax, in this new version, is very clear:

document.id('el').crossfade('end_image.jpg');

Just remember your element position property in CSS should be expressly declared (as absolute, relative or fixed), don’t leave it blank.

Note: you can customize the fade behavior by setting tween properties

document.id('el').set('tween', {duration:5000});

These will be inherited by ‘crossfade’ animation.

DemoDownload

Related Posts:

One Response to Image Tween with Element.crossfade for MooTools

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>