JS Code for automatic page maximization Effect

Source: Internet
Author: User

Code 1: The most common code, relatively simple
The Code is as follows:
<Script language = "javascript">
Self. moveto (0, 0)
Self. resizeto (screen. availwidth, screen. availheight)
</Script>

Code 2:
Run the following code between The Code is as follows:
<Script language = "javascript">
<! -- Function winfix (){
If (document. layers ){
Width = screen. availWidth-10;
Height = screen. availHeight-20;
} Else {
Var width = screen. availWidth-2;
Var height = screen. availHeight;
}
Self. resizeTo (width, height );
Self. moveTo (0, 0 );
}
// -->
</Script>

Run the following code in the <body> Tag:
The Code is as follows:
<Body onload = "winfix ()">

Code 3:
The Code is as follows:
<Script language = "javascript">
Self. moveTo (0, 0)
Self. resizeTo (screen. availWidth, screen. availHeight)
</Script>
<OBJECT id = "max" type = "application/x-oleobject" classid = "clsid: adb880a6-d8ff-11cf-9377-
00aa003b7a11 ">
<PARAM name = "Command" value = "Maximize"> </OBJECT>
<BODY onload = "if (document. body. offsetWidth <screen. width) max. Click ()">

Code 4:
The Code is as follows:
<SCRIPT>
Var mywidth
If (navigator. appName. indexOf ('netscape ')! =-1 ){
Mywidth = parseInt (window. outerWidth)-28;
// Alert ("ns ")
}
Else {
If (navigator. appName. indexOf ('Microsoft ')! =-1 ){
Mywidth = document. body. clientWidth;
// Alert ("ie ")
}
}
Var ScreenOffset;
If (mywidth <= 778 ){
// Alert ("1 ")
} Else {
ScreenOffset = parseInt (mywidth-778)/2 );
ScreenOffset = 0;
// Alert ("2 ")
}
FwLoadMenus ();
Window. onresize = function (){
If (navigator. appName. indexOf ('netscape ')! =-1 ){
Mywidth = parseInt (window. outerWidth)-28;
If (self. screenLeft> 0 ){
Maximize. Click ();
}
}
Else {
If (navigator. appName. indexOf ('Microsoft ')! =-1 ){
Mywidth = document. body. clientWidth;
If (self. screenLeft> 0 ){
Maximize. Click ();
}
}
}
}
Function ChangeLocation (){
Var size = screen. width;
If (size! = & Quot; 1024 & quot "){
Document. location = "index_800_600.aspx ";
}
}
</SCRIPT>

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.