我有一个自定义面板,现在我为面板添加了动画,以便在按钮单击时显示。现在的问题是开始& &;动画的停止位置。我想设置从动画开始和结束的位置。
现在我这样做
showAnimation: {
type: 'slideIn',
direction: 'up',
duration: 400,
easing: 'ease',
listeners: {
animationend: function(evt, obj) {
// my code here
}
}
}
这显示了屏幕底部的弹出窗口,但我不想从屏幕底部一直显示出来。有办法吗?
可以用Ext.Animator.run
代替showAnimation
。示例如下:
Ext.Animator.run({
element: this.getNavigation().element, // this.getYourViewObject().element
duration: 500,
easing: 'ease-in',
preserveEndState: true,
from: {
top: document.body.clientHeight // Max Height i.e Bottom
},
to: {
top: 0 // Height where you want to stop your Slide View
}
});
如果你仍然不明白,请随意评论。我给你做一个Demo