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

Summary


In this chapter, we learned how to build a plugin; a plugin that automatically captions images in a web page with their respective alt (or title) property.

This is what we covered in this chapter:

  • Designing a plugin: We created a design sheet that we can easily reference as we build our plugin, and when we document it for public use.

  • How to convert a script to a flexible MooTools class: We converted an image captioning script that we wrote into a class (plugin) with various options that allow its class instance to be customized.

  • Instantiating our plugin: We learned how useful plugins can be in allowing us to customize instances to reduce the amount of code we have to write (and re-write).

  • How to properly document our plugin: We followed documentation and used the MooTools coding style and plugin documentation to let other MooTools developers quickly learn how to implement our plugin into their own projects.

At this point, you're now officially a MooTools rockstar!