ysjfirst

 

根据内容自动调整弹出窗口大小的JS解决方案

<script language=javascript>
function win_onLoad(){
var width = document.all["tblKsList"].offsetWidth;    
var height = document.all["tblKsList"].offsetHeight; 

width 
= eval(width + 50);
height 
= eval(height + 50);

if (width < 500)
width 
= 500;
else if (width > screen.width)
width 
= screen.width;

if (height < 400)
height 
= 400;
else if (height > screen.height)
height 
= screen.height;

//alert(width);alert(height);
window.resizeTo(width,height);
}
</script>

posted on 2005-08-28 16:50  袁帅钧  阅读(959)  评论(0编辑  收藏  举报

导航