问题描述
作为标题,我想知道在事件结束后如何触发函数.谢谢!
as title, I would to knoe how can I do to fired a function after the end of an event.Thanks!
推荐答案
Fx类均支持多个事件:
the Fx classes all support several events:
在完成最后一个动画时触发.
fires when the last animation is done.
element.set("tween", {
onComplete: function() {
this; // the Fx.Tween instance
this.element; // the element that tweened
}
}).tween("opacity", [0, 1]);
onStart
在动画开始时触发.
onStart
fires when an animation begins.
var myMorph = new Fx.Morph(element, {
onStart: function() {
this.element.addClass("disabled");
}
});
myMorph.start({marginLeft: [-200, 0]});
onCancel
在停止动画时触发.
onCancel
fires when you stop an animation.
此外,Fx.Elements具有一组通用的相同事件,适用于所有受控动画.
also, Fx.Elements has a generic set of the same events that apply for all controlled animations.
在文档中查看. http://mootools.net/docs/core/Fx/Fx.Morph 例如-和Fx文档.您可以使用任何事件或事件的组合.
have a look in the docs. http://mootools.net/docs/core/Fx/Fx.Morph for example - and the Fx docs. you can use any event or a combination of events.
您还可以将link: "chain"
或取消"或忽略"等设置为高级控制.
you can also set link: "chain"
or "cancel" or "ignore" etc for advanced control.
这篇关于Mootools:在补间或变形FX或其他事件结束后如何触发一个(或多个)函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!