原因很简单:如果动画没有调用结束时间,就调用清除代码。
Ext.Component.prototype.animateFn = // or Ext.override( Ext.Component, { animateFn: function (animation, component, newState, oldState, options, controller) { var me = this; if (animation && (!newState || (newState && this.isPainted()))) { this.activeAnimation = new Ext.fx.Animation(animation); this.activeAnimation.setElement(component.element); if (!Ext.isEmpty(newState)) { var onEndInvoked = false; var onEnd = function () { if (!onEndInvoked) { onEndInvoked = true; me.activeAnimation = null; controller.resume(); } }; this.activeAnimation.setOnEnd(onEnd); window.setTimeout(onEnd, 50 + (this.activeAnimation.getDuration() || 500)); controller.pause(); } Ext.Animator.run(me.activeAnimation); } };