replace bindwithevent function in mootools 1.3 (upgrade from 1.2)
Dear all, as MooTools 1.3 is out开发者_运维知识库 now, i´m going to update some scripts. BindWithEvent is now deprecated and has to be replaced, but how?
See this:
new Element('div', [.....]).addEvent('click',this.close.bindWithEvent(this,true));
I´m quite sure it has to be some sort of a function
new Element('div', [.....]).addEvent('click',function (event) { ????? } );
But how to bind with the upper close event?
From the docs,
Function method: bindWithEvent
This function has been deprecated.
Example how you could replace this method:
myElement.addEvent('click', function(e){
myFunction.bind(bind, [e]);
});
精彩评论