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

Sending a Corvette on a list of errands—extending a class with a chain

To gain some familiarity with how chains work, look in Chapter 7, Knock And the Door Will Open: Events and Listeners for more chaining recipes that do not include the minor complexity of Implements.

Getting ready

Create a canvas where the tasks completed can be written and a trigger to fire each task.

<h1>Taskinator:</h1>
<form action="" method="get">
<input type="button" value="Do Next Task!" id="taskinator"/>
</form>
<h1>Items Done:</h1>
<div id="itemsdone"></div>

How to do it...

  1. Implement the chain
  2. Load the chain with actions
  3. Fire off the actions in the chain

Follow these steps:

  1. Create a class that implements Chain with a method that will append a new action to the class's internal ...

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