JavaScript Window Function Guide Customized New Window

zhaozj2021-02-08  219

New custom window (Author: hear the wind compiled in January 2001 on 19 Ri 11:35) JavaScript function window guide of basic grammatical structures window.open () method is: window.open (sURL, sName); however, you can Customize new windows using 2 additional parameters: Window.Open (SURL, SNAME [, SFEATURES] [, BREPLACE]); you can use the default feature by omitting these parameters. Let's take a look at the Breplace parameters, which is only supported by Internet Explorer: 4 and later. This parameter is only useless when the second parameter is named a already existing window. It is a boolean type value. If true, it means that the first parameter specified by the first parameter replaces the current window browsing location in history. If false, it means that a new project is created in the window of the window ( This is the default). Since this parameter is only supported by Microsoft's browser, it is not very useful. Let's take a look at the nature of the widely known JavaScript window. The 3nd parameter of the Open () method is a string that contains a comma-separated list (not to include any spaces). Let us look at their meaning before entering the available functional ocean. Here is an example: win = window.open ("http://www.docjs.com/", "docjs", "location = 1, menubar = 1, resizable = 1"); this statement opens a variable size Window, it comes with an address bar and a menu strip, while other features are turned off. For example, no status feature is specified, the new window has no status bar. Note that there are several other methods to define window features. Below is a few and the equivalent of the equivalence function: Win = WINDOW.OPEN ("http://www.docjs.com/", "DOCJS", "Location, Menubar, ResiZable"); Win = WINDOW.Open ("http://www.docjs.com/", "DOCJS", "location = yes, menubar = yes, resizable = yes"); Win = WINDOW.OPEN ("http://www.docjs.com/ "," DOCJS "," location, menubar = 1, resizable = yes "); Many features can be yes, or NO. For these features, you can use 1 replacement Yes, 0 instead of NO. If you want to activate a feature, you can also simply list the name of the feature in the SFEATURES string. If not listed, it means that the mask is shielded (except for Titlebar and HotKeys). The SFEATURES parameter is a list of comma-separated features, where no spaces or blank characters should be included. Each element in the list should contain the following format: feature [= value] Assigning a SFEATURES parameter has a big difference between a null string and all omitted this parameter. If you call open () without any parameters, all features are set to the default value.

In other words, the browser will create a window that has a default width and height, standard menu, toolbar, and other browser features. If you use an empty string as a list of features that require functions, the browser will open a window, all of which is masked (except for Titlebar and HotKeys). The second parameter sname of the Window.open () method specifies the name of the window. If it is a name that already exists, the browser loads the specified URL (SURL) in that window. Therefore, if the SNAME specifies the existing window, the browser will ignore the defined list of features. Not all window features can be supported by all browsers. If the browser cannot identify the specified feature, it simply ignores it. Let's take a look at the definition of various window features in JavaScript:

alwaysLoweredinnerWidthscreenYalwaysRaisedleftscrollbarschannelmodelocationstatusdependentmenubartitlebardirectoriesouterWidthtoolbarfullscreenouterHeighttopheightmenubarwidthhotkeysresizablez-lockinnerHeightscreenX alwaysLowered Internet Explorer: does not support the Navigator: version 4 specified window always remains at the bottom of the stack. In other words, regardless of whether the new window is activated, it is always under other windows. Window.Open ("AlwayslowRed.html", "_blank", "alwayslowered"); ALWAYSRAISED Internet Explorer: Does not support Navigator: Version 4 Specifies the top of the stack. In other words, no matter whether the new window is activated, it is always on other windows. Window.open ("Alwaysraiad.html", "_blank", "alwaysraised"); CHANNELMODE Internet Explorer: Version 4 Navigator: Does not support whether the specified is displayed in accordance with the theater mode display window, and whether the channel area is displayed. Window.Open ("ChannelMode.html", "_BLANK", "CHANELMODE"); Dependent Internet Explorer: does not support Navigator: Version 4 defines whether the window becomes the dependent sub-window that is currently open. Relying on the window is when its parent window is turned off, it is immediately turned off. On the Windows platform, a dependent window does not display on the taskbar. Window.Open ("Dependent.html", "_BLANK", "Depend"); Directories Internet Explorer: All versions Navigator: All versions Specify whether to display the directory button (such as a well-known "What's Cool" and "What's New" button). Internet Explorer references these directory buttons to the link toolbar, Navigator (version 4, and above) called personal toolbar. Window.open ("Directories.html", "_blank", "Directories"); FullScreen Internet Explorer: Version 4 Navigator: Does not support whether defined is to open the browser in full screen. Be careful to use full screen mode, because in this mode, the browser's title bar and menus are hidden, all you should provide a button or another visual clue to help users close this window. Of course, you can close the window using hotkeys Alt F4.

Window.Open ("Fullscreen.html", "_blank", "fullscreen"); Height Internet Explorer: All versions Navigator: All versions define the height of the window document display area in pixel Pixel, minimum value of 100. If only the height is defined, Internet Explorer uses a given height and the default width. For Navigator, this property will be ignored if Width or InnerWidth is specified at different times. WINDOW.OPEN ("Height.html", "_blank", "height = 200, width = 300"); HotKeys Internet Explorer: does not support Navigator: Version 4 If there is no definition (or 0), then it is blocked Most of the hot keys in the new window of the menu strip. But safety, and exit hotkeys are still retained. Window.Open ("HotKeys.html", "_blank", "HotKeys = 0, MenuBar = 0"); InnerHeight Internet Explorer: Navigator: Version 4 Defines the height of the window document display area in pixel Pixel, The minimum value is 100. In Navigator Release 4, this feature replaces Height, which is backward compatible. For Navigator, this property will be ignored if Width or InnerWidth is specified at different times. Window.open ("InnerHeight.html", "INNLANK", "InnerHeight = 200, InnerWidth = 300"); InnerWidth Internet Explorer: Navigator: Version 4 Defines the width of the window document display area in pixel Pixel. The minimum value is 100. In Navigator Version 4, this feature replaces width, which is compatible to keep backward. For Navigator, this property will be ignored if height or innerHeight is specified at different times. Window.open ("InnerWidth.html", "INNLANK", "InnerHeight = 200, InnerWidth = 300"); Left Internet Explorer: Version 4 Navigator: Does the X left label that defines the window in pixels in pixels. WINDOW.OPEN ("Left.html", "_blank", "Left = 20"); Location Internet Explorer: All versions Navigator: All versions define whether to display the text domain for address URL in the browser.

WINDOW.OPEN ("Location.html", "_blank", "location"); MenuBar Internet Explorer: All versions Navigator: All versions define if the menu bar is displayed (the menu is located at the top of the window, including "file" and "editing", etc. ). Window.open ("MenuBar.html", "_blank", "Menubar"); OuterHeight Internet Explorer: Navigator: Version 4 defines the total height of the window (its external boundary) in pixels (its external boundary) More than 100, because the height of the window content area must be at least 100. If OuterWidth is not defined, Navigator will ignore this feature. WINDOW.OPEN ("OuterHeight.html", "OuterHeight.html", "OuterWidth = 300"); OuterWidth Internet Explorer: does not support Navigator: Version 4 defined in pixels (its external boundaries) The total width, the minimum value is more than 100, because the width of the window content area must be at least 100. If OuterHeight is not defined, Navigator will ignore this feature. Window.Open ("OuterWidth.html", "OuterWidth.html", "OuterWidth = 300"); Resizable Internet Explorer: All versions of Navigator: All versions define whether the window can make sizes via its boundary. Depending on the platform, the user may have other methods of changing the window size. Window.Open ("Resizable.html", "_blank", "resizable"); Screenx Internet Explorer: Navigator: Version 4 defines the X coordinate of the window in pixels. Window.open ("Screenx.html", "" Screen "," Screenx = 20 "); Screeny Internet Explorer: does not support Navigator: Version 4 defines the Y coordinates of the window in pixels. Window.Open ("Screeny.html", "_blank", "Screeny = 20"); Scrollbars Internet Explorer: All versions Navigator: All versions define whether to activate horizontal and vertical scroll bars. Window.Open ("Scrollbars.html", "_blank", "scrollbars"); Status Internet Explorer: All versions Navigator: All versions define whether to add a status bar in the lower part of the window.

转载请注明原文地址:https://www.9cbs.com/read-3462.html

New Post(0)