Javascript: window. Open maximize window settings and details

Source: Internet
Author: User
The main purpose is to use JavaScript: window. open () for browsers such as ie6.0, 7.0, 8.0, chorme, Safari, and Firefox.

To maximize usage at the beginning
<A href = "javascript: void window. open ('https: // www. sina. com.cn/', 'XX', 'fullscreen, scrollbars, resizable = Yes, toolbar = no') "> open </a>
For ie6.0, the effect is full screen, but there is no such button, you must open the task manager to turn it off, which is inconvenient for users.
Safari does not work at all, but the original form size is opened.

The correct method is:
<A href = "javascript: void window. open ('https: // www.sina.com.cn/', 'XX', 'left = 0, Top = 0, width =' + (screen. availwidth-10) + ', Height =' + (screen. availHeight-50) + ', scrollbars, resizable = Yes, toolbar = no') "> open </a>
These browsers are OK

Add some introduction to window. open ().

1. Basic syntaxWindow. Open (pageurl, name, parameters)

2.Parameters
Here, yes/no can also use 1/0; pixel value is a specific value, in pixels.

Parameter | value range | description

Alwayslowered | yes/no | specifies that the window is hidden behind all windows
Alwaysraised | yes/no | specify that the window is suspended above all windows
Depended | yes/no | whether to close the parent window at the same time
Directories | yes/no | whether the directory bar of nav2 and 3 is visible
Height | pixel value | window height
Hotkeys | yes/no | set the Security Exit hotkey in the window without menu bar
Innerheight | pixel value | pixel height of the document in the window
Innerwidth | pixel value | pixel width of the document in the window
Location | yes/no | whether the location bar is visible
Menubar | yes/no | whether the menu bar is visible
Outerheight | pixel value | set the pixel height of the window (including the decorative border)
Outerwidth | pixel value | set the pixel width of the window (including the decorative border)
Resizable | yes/no | whether the window size can be adjusted
Screenx | pixel value | pixel length between the window and the left boundary of the screen
Screeny | pixel value | pixel length between the window and the upper boundary of the screen
Scrollbars | yes/no | whether the window has a scroll bar
Titlebar | yes/no | whether the title bar of the window is visible
Toolbar | yes/no | whether the toolbar of the window is visible
Width | pixel value | pixel width of the window
Z-Look | yes/no | whether the window floated above other windows after being activated

3. An example

The appearance, size, and position of the pop-up window to adapt to the specific situation of the page.

  1. <Script Language="JavaScript"> 
  2. <! --
  3. Window. Open ('page.html ', 'newwindow ',' Height = 100 , Width = 400 , Top = 0 , Left = 0 , Toolbar = No , Menubar = No , Scrollbars = No , Resizable = No , Location = No , Status = No ')
  4. // Write a row
  5. --> 
  6. </Script> 

Parameter description:
<Script language = "JavaScript"> the JS script starts;
Window. Open command to pop up a new window;
'Page.html 'name of the pop-up window;
'Newwindow' indicates the name of the pop-up window (not the file name). It is optional and can be replaced by null;
Height = 100 window height;
Width = 400 window width;
Top = the pixel value between the 0 window and the top of the screen;
Left = 0 the pixel value between the window and the left of the screen;
Toolbar = No indicates whether to display the toolbar. Yes indicates display;
Menubar and scrollbars indicate the menu bar and scroll bar.
Resizable = No: whether to change the window size. Yes: Yes;
Location = No indicates whether the address bar is displayed. Yes indicates yes;
Status = No whether to display the information in the status bar (usually the file has been opened), yes is allowed;
</SCRIPT> end of JS script

Related Article

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.