http://www.mootools.net/docs/core/Native/Function#Function:bindWithEvent

the example looks like this... and it tosses and error in firebug...

var Logger = new Class({
    log: function(){
        console.log.apply(null, arguments);
    }
});

var Log = new Logger();

$('myElement').addEvent('click', function(event, offset){
    offset += event.client.x;
    this.log('clicked; moving to:', offset); // this refers to
myClass
    event.target.setStyle('top', offset);
    return false;
}).bindWithEvent(Log, 100));

---------------------------------
I think it should be this...

var Logger = new Class({
    log: function(){
        console.log.apply(null, arguments);
    }
});

var Log = new Logger();

$('myElement').addEvent('click', function(event, offset){
    offset += event.client.x;
    this.log('clicked; moving to:', offset); // this refers to
myClass
    event.target.setStyle('top', offset);
    return false;
}.bindWithEvent(Log, 100));



I hope this helps!! =D

Steve

Reply via email to