【发布时间】:2011-06-17 01:39:47
【问题描述】:
最好的方法是什么?例如:
当用户单击minimize 按钮时,我希望窗口消失(qx.fx.effect.core.Fade(DOM))。所以我在窗口类中这样做了:
this.addListener("appear", function() {
this.minimizeEffect = /*fade effect*/;
},this);
this.addListener("beforeMinimize", function() {
this.minimizeEffect.start();/*delay(1000);*/
},this);
我需要延迟,因为(我认为)否则窗口会在它刚刚开始褪色时最小化!
有什么解决办法吗?我什至用finish 效果事件尝试过,但没有运气。
谢谢!
编辑:
我的delay() 函数是错误的.. 所以它不会“编译”,这让我更加困惑:
function delay(ms){//this works (it fades ok)
var date = new Date();
var curDate = new Date();
while(curDate-date < milis)//this is wrong, milis don't exist
curDate = new Date();
}
function delay(ms){//it donesn't work (no fade)
var date = new Date();
var curDate = new Date();
while(curDate-date < ms)//this is "good"
curDate = new Date();
}
【问题讨论】: