Chain Sample
公式のサンプルソースが動かない件について
by Tenderfeel
HTML
<div id="log"></div>
JavaScript
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]'));
this.callChain();
}, function() {
$('log').grab(new Element('p[text=go workout]').fade('in'));
this.callChain();
}, function() {
$('log').grab(new Element('p[text=code mootools documentation until eyes close involuntarily]').fade('in'));
this.callChain();
}, function() {
$('log').grab(new Element('p[text=sleep]'));
}
);