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

Time for action—exploring the MooTools Core Builder


To explore the MooTools Core Builder, perform the following steps:

  1. Go to the MooTools Core Builder webpage by navigating to: http://mootools.net/core.

  2. Notice that the MooTools Core is subdivided into 7 sections. Each section has 2 to 6 JavaScript libraries associated with it. Take the time to read each description to help you get a better understanding of what each file does.

  3. Click on the Event component. Notice that several other components were automatically selected for you. This ensures that you also include the dependency files that are required for the Event component to run.

  4. Notice the different compression types. YUI Compressor is selected by default.

What just happened?

We just covered how to roll your own MooTools Core file and learned about the MooTools Core structure by exploring the MooTools Core builder. Once you're comfortable with how MooTools works, you should use the MooTools Core Builder to create a MooTools Core file that includes only the components you need.

Have a go hero explore the MooTools Core Builder output

Try to download the previous example with the Events component checked. After downloading your own version of the MooTools Core, open the file in your favorite text editor. Also open the MooTools Core file that you downloaded earlier. Notice that the one you just downloaded is significantly shorter; that's because you only downloaded the Events component and its dependency files.

The entire uncompressed MooTools Core is close to 4,000 lines long (and has a file size of 96 KB).

In comparison, the Core Builder output where only Events and its dependencies are included is just a little over 1,000 lines of code (and weighing only 24 KB).

MooTools More

The second part of the MooTools framework is simply called More. As the name implies, it is a collection of useful plugins, functions, classes, and methods that extends the MooTools Core.