开发者

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]);
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜