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

MooTools' Fx class


The MooTools Fx class is where the magic happens (or at least, one of the places where it happens). It contains the framework's animation effects logic that will help you transform CSS properties in a smooth and slick fashion. Before we get started with the fun stuff, let's go over the basics.

Basic syntax

Declaring a new Fx object follows the same syntax as declaring any other object in MooTools (like a new Event in Chapter 5). You create a new Fx object using the following format:

var nameOfFxObject = new Fx([options]);

However, it's unlikely that you will use the Fx class in the above manner, but rather, you'll use one of its extensions (Fx.Tween or Fx.Morph).

Let's go over the options and properties you can use to define your animation effect.

Fx options

You have a myriad of options that you can take advantage of inside the Fx class, giving you unprecedented control over your JavaScript animation effects. In the following table, you'll find the option name, the data type...