As far as I know, "toggle" on mootools does not exist.
You could "implement" this, for example, as follows: http://www.jsfiddle.net/steweb/rdvx8/
Is this what you would like to receive?
Edit (for mootools: D developers), this may be a way to create a common “switch”:
Element.implement({
toggle: function(fn1,fn2){
this.store('toggled',false);
return this.addEvent('click',function(event){
event.stop();
if(this.retrieve('toggled')){
fn1.call(this);
}else{
fn2.call(this);
}
this.store('toggled',!(this.retrieve('toggled')));
});
}
});
$('mya').toggle(
function() {
this.set('html', 'new text');
},
function() {
this.set('html', 'old text');
}
);
here: http://www.jsfiddle.net/steweb/qBZ47/
2 http://jsfiddle.net/dimitar/UZRx5/ ( @ )