自动调整弹出窗口的动画效果
Main.aspx
控制窗口大小 this.ShowModalDialog(url, 500, 500, ""); 弹出Edit.aspx
Edit.aspx
<body onload="dlgAutoResize('tblMain');">
JS
function dlgAutoResize(tblID){ var width = document.all[tblID].offsetWidth; var height = document.all[tblID].offsetHeight; width = eval(width + 52); height = eval(height + 82); if (width > screen.width) { width = screen.width; } if (height > screen.height) { height = screen.height; } }
function dlgAutoResize(tblID) { resize=setInterval(Func, 1000); } function Func() { var width = document.all['tblMain'].width; var height = document.all['tblMain'].height; if(width < screen.width) { if(width=="") width=document.all['tblMain'].offsetWidth; document.all['tblMain'].width=eval(parseInt(width*(1+0.1))); } if(height < screen.height) { if(height=="") height=document.all['tblMain'].offsetHeight; document.all['tblMain'].height=eval(parseInt(height*(1+0.1))); } }
[解决办法]
多写了resize,用下面这个
function dlgAutoResize(tblID) { setInterval(Func, 1000); } function Func() { var width = document.all['tblMain'].width; var height = document.all['tblMain'].height; if(width < screen.width) { if(width=="") width=document.all['tblMain'].offsetWidth; document.all['tblMain'].width=eval(parseInt(width*(1+0.1))); } if(height < screen.height) { if(height=="") height=document.all['tblMain'].offsetHeight; document.all['tblMain'].height=eval(parseInt(height*(1+0.1))); } }
[解决办法]如需要阅读该回复,请登录或注册CSDN!