Sergio Panagia Blog

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

One Response to Image Tween with Element.crossfade for MooTools

Lascia un Commento

L'indirizzo email non verrĂ  pubblicato. I campi obbligatori sono contrassegnati *

*

*

È possibile utilizzare questi tag ed attributi XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>