Book Image

MooTools 1.2 Beginner's Guide

Book Image

MooTools 1.2 Beginner's Guide

Overview of this book

MooTools is a simple-to-use JavaScript library, ideal for people with basic JavaScript skills who want to elevate their web applications to a superior level. If you're a newcomer to MooTools looking to build dynamic, rich, and user-interactive web site applications this beginner's guide with its easy-to-follow step-by-step instructions is all you need to rapidly get to grips with MooTools.
Table of Contents (14 chapters)
MooTools 1.2 Beginner's Guide
Credits
About the Authors
About the Reviewer
Preface

Other Fx methods


There are several Fx methods that are useful for working with animation Fx. You've already seen one of them, the start() method, which simply starts an animation effect. In this section, we shall go over methods available to you when working with MooTools animation.

Starting an effect

The start() method allows you to start an effect. It takes in the properties you'd like to transition, and their end value. Here are a few examples of using the start method format on instances of Fx.Tween and Fx.Morph.

// In Fx.Tween this transitions the width from the current value //to 100px
myTween.start('width', 100);
// In Fx.Tween this transitions the width from 50px to 100px
myTween.start('width', 50, 100);
// In Fx.Morph this transitions the height to 100 and the color //to #ff0000
myMorph.start({
'height' : 100,
'color' : #ff0000
});
// In Fx.Morph this transitions the height from 50px to 100px
myMorph.start({
'height' : [50px, 100px]
});

Setting properties immediately

If you want to...