O'Reilly logo

MooTools 1.3 Cookbook by Jay Larry G. Johnston

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Enough Is Never Enough: Extending MooTools

MooTools, an extensible JavaScript library, begins with a base Class and then Implements and Extends classes into useful and reusable objects.

Implement the recipes in this chapter to extend what MooTools can do for you:

  • Working directly with the base class, Class
  • Extending and implementing MooTools classes
  • Extending and implementing MooTools elements

Making a Corvette out of a car—extending the base class

The "base class" is a function, a method, that allows extension. Just what does extending a class entail? Buckle up and let us take a drive.

Getting ready

Just to show the output of our work, create a DIV that will be our canvas.

<div id="mycanvas"></div>

How to do it...

Creating a class from the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required