js| pop-up window | solve
Problem
When the creation of pain, according to the contents of the window to automatically adjust the size of the window, if the screen is equal to the size of the scroll bar appears.
Solution
Add a JS script method to the pop-up page Win_onload (), in the body of the OnLoad method to refer to Win_onload (), add a table in the body, the table ID named Tbllist, The size of the window is the size of the table plus 50 on the width and height.
Some of the code is as follows:
<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 <)
Width = 500;
Else if (Width > screen.width)
width = screen.width;
if (height <)
Height = 400;
Else if (height > screen.height)
height = screen.height;
//alert (width); alert (height);
Window.resizeto (width,height);
}
</script>
<body bgcolor= "0099CC" leftmargin= "0" topmargin= "0" marginwidth= "0" marginheight= "0" >
<table width= "border=" 0 "cellpadding=" 0 "cellspacing=" 0 "class=" table-left1-right2 "style=" border:1 Solid 000000 "id=" Tbllist ">
<TR>
<TD width= "100%" valign= "Top" colspan=2>
Welcome to use!
</TD>
</TR>
</TABLE>
</BODY>