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

Chapter 6. Bringing Web Pages to Life with Animation

Users expect a highly-interactive experience when interfacing with websites and web applications. With MooTools, you can create stunning animation within your web pages with MooTools' smooth and slick JavaScript effects.

In this chapter we shall:

  • Learn about the MooTools Fx class

  • Learn how to animate a CSS property of an element

  • Discover how to animate multiple CSS properties of an element

  • Investigate some of Fx's useful methods for working with MooTools effects

So let's get on with it!

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...