Pop-up windows several ways

Source: Internet
Author: User

<!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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.