var Todo = new Class({
Implements: Chain,
initialize: function() {
this.chain.apply(this, arguments);
this.callChain();
}
});
var myTodoList = new Todo(
function() {
$('log').grab(new Element('p[text=get groceries]',{'morph':{'duration':3000}}).morph({'color':['#f00','#00f'],'padding':[0,50]}));
this.callChain.delay(500, this);
}, function() {
var p = new Element('p[text=go workout]',{'tween':{'duration':3000,'property':'background-color'}});
$('log').grab(p);
p.tween('#fff','#ccc');
this.callChain.delay(3000, this);
}, function() {
$('log').grab(new Element('p[text=code mootools documentation until eyes close involuntarily]').fade('hide').fade(1));
this.callChain.delay(500, this);
}, function() {
$('log').grab(new Element('p[text=sleep]'));
}
);
<div id="log"></div>