昨天学习ext的时候 想模拟一个进度条弹窗 大概这样
Ext.onReady(function () { var msgBox = Ext.MessageBox.show({ title:'提示', msg:'请稍后', modal:true, width:300, progress:true, animEl:"esttest", buttons:Ext.MessageBox.YESNOCANCEL, icon:Ext.MessageBox.QUESTION }); for(var i = 1; i < 10; i++){ setTimeout(function(){ var x=a/9; msgBox.updateProgress(x,Math.round(x*100)+"% 正在加载"); },1000*a); } });
实际运行并不不能达到预期,查阅资料才知道 for