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 5. Working with Events

In this chapter, we'll be exploring browser events. We'll also see how MooTools can help us watch out for events such as mouse clicks, mouse movements, keyboard presses, and all the events that make our web pages more responsive to user actions.

In this chapter, we shall:

  • Define what events are in web development terms

  • Learn how to add event listeners to web page elements

  • Find out how to create custom events to extend MooTools' event object

  • Learn how to remove, clone, and fire off events

  • Investigate MooTools events methods and properties

We have a lot of things to cover in this chapter, so hold on to your seats and enjoy the ride!

What are events exactly?

Events are simply things that happen in our web pages. MooTools supports all HTML 4.01 event attributes like onclick and onmouseout, but the framework refers to them without the "on" prefix (click instead of onclick, mouseout instead of onmouseout).

What's neat about MooTools is that it not only extends HTML 4.01 event...