我想将面板从下向上移动。顺利。为此,我尝试了这段代码。
Ext.define("mathmania.view.Main", {
extend: 'Ext.Panel',
requries: [
'Ext.util.DelayedTask'
],
xtype: 'panel',
config: {
autodestory: true,
border: 1,
html: 'test panel',
bottom: 0,
centered: true,
padding: 10,
margin: '2%',
width: '95%',
listeners: {
painted: 'countdown'
}
},
countdown: function()
{
var task = Ext.create('Ext.util.DelayedTask', function() {
this.setBottom(this.getBottom + 5);
task.delay(100);
});
task.delay(0);
}
但每次它只工作一次而不是多次作为重复任务?为了顺利移动这个浮动面板,有没有更好的方法或者我在这段代码中缺少什么?