<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> pop-up windows several methods </title>
<script language= "Web Effects" >
<!--
window.open ("Openvps Tutorial. html", "NewWindow", "height=718, width=400, top=0,left=0, Toolbar=no, Menubar=no, scrollbars= No, Resizable=no,location=no, Status=no ")
Write a line
-->
</script>
<body>
</body>
Parameter explanation:
<script language= "Web Effects" > Web effects script started;
window.open the command to eject a new window;
The filename of the ' page.html ' pop-up window;
' NewWindow ' pop-up window name (not filename), not required, available null ' instead;
height=100 window height;
width=400 window width;
The pixel value of the Top=0 window from the top of the screen;
The pixel value of the left=0 window from the left side of the screen;
Toolbar=no whether the toolbar is displayed, yes for display;
Menubar,scrollbars represents the menu bar and scroll bar.
Resizable=no whether to allow changes to the window size, yes to allow;
Location=no whether the address bar is displayed, yes is allowed;
Status=no whether the information in the status bar is displayed (usually the file is open), yes to allow;
</script> Web Effects script End
Control the number of pop-up windows
<script>
function Openwin ()
{window.open ("page.html", "", "width=200,height=200")}
function Get_cookie (name)
{var search = name + ' = '
var returnvalue = "";
if (Documents.cookie.length > 0) {
offset = documents.cookie.indexof (search)
if (offset!=-1) {
Offset + = Search.length
End = Documents.cookie.indexof (";", offset);
if (end = = 1)
end = Documents.cookie.length;
Returnvalue=unescape (documents.cookie.substring (offset,end))
}
}
Return returnvalue;
}
function Loadpopup () {
if (Get_cookie (' popped ') = = ") {
Openwin ()
Documents.cookie= "Popped=yes"
}
}
</script>
The following code can control the pop-up window in the center of the page
<script language= "JavaScript" >
function Openwin (U, W, h) {
var L = (screen.width-w)/2;
var t = (screen.height-h)/2;
var s = ' width= ' + w + ', height= ' + H + ', top= ' + t + ', left= ' + L;
s + = ', Toolbar=no, Scrollbars=no, Menubar=no, Location=no, Resizable=no ';
Open (U, ' Owin ', s);
}
</script>
<a href= "javascript:void (Openwin (' http://www.111cn.net/', 600, 500));" >test</a>