How do I eject a Web form of a certain size?

Source: Internet
Author: User

How do I eject a Web form of a certain size?
Excerpt from: Http://blog.163.com/[email protected]/blog/static/17044246920108413348344/

One. window.open usage

1, window.open () Support environment: JAVASCRIPT1. 0+/JScript1. 0+/Nav2+/IE3+/Opera3+


2. Basic syntax:
window.open (Pageurl,name,parameters)
which
Pageurl as child window path
Name is a child window handle
Parameters is the window parameter (each parameter is separated by commas)

3. Example:

1).

<SCRIPT>
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 ")     // write a line  
script>

After the script runs, Page.html will open in the new form NewWindow, with a width of 100, a height of 400, 0 pixels from the top of the screen, 0 pixels left on the screen, no toolbars, no menu bars, no scroll bars, no resizing, no address bar, no status bar.
Please compare.

2).

<script>
LinkButton1.window.open ("default2.aspx", "", "width=400,height=300")//Write a line
</script>

In the above example, there are a few parameters that are commonly used, and there are many other parameters, see four.

4, the Parameters:
where Yes/No can also be used 1/0Pixel value is a specific value, in pixels.
Parameters|Range of values|Description
Alwayslowered|Yes/No|Specifies that the window is hidden after all windows
Alwaysraised|Yes/No|Specifies that the window hovers above all windows
Depended|Yes/No|Whether to close at the same time as the parent window
Directories|Yes/No|NAV2 and 3 's catalog columns are visible
Height|Pixel value|Window height
Hotkeys|Yes/No|Set safe exit Hotkey in window without menu bar
Innerheight|Pixel value|The pixel height of the document in the window
Innerwidth|Pixel value|The 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|The pixel length of the window from the left edge of the screen
ScreenY|Pixel value|The pixel length of the window from the top edge of the screen
ScrollBars|Yes/No|Whether the window can have a scroll bar
TitleBar|Yes/no |   Window title bar is visible  
Toolbar |  yes/no |< Span style= "color: #000000;" >  whether the window toolbar is visible  
Width   pixel value |   window pixel width  
Z-look |  yes/no < Span style= "color: #000000;" >|   window is activated, floats on top of other windows

Two. Window.showmodelessdialog usage

Window.showmodelessdialog ("url", "name", "parameter: value; parameter: value; ...")
URL: Dialog box window link address
Name: Names of dialog boxes, which can be empty
Scroll: Whether there is a scroll bar, 0 means none, 0 means there is
Status: Whether there is a state bar, 0 means none, 0 means there is
Help: Whether there is a question mark, 0 means none, 0 means there is
Resizable: Whether you can use the mouse to drag to change the size of the box, 0 means no, not 0 means you can
Dialogwidth: Dialog box width value
Dialogheight: Dialog box height value

Window.showmodelessdialog () method

window.showmodaldialog (sURL [, varguments] [, Sfeatures])
Vreturnvalue = Window.showmodelessdialog (sURL [, varguments] [, sfeatures])
Parameter description:
sURL
Required parameter, type: String. Used to specify the URL of the document to be displayed by the dialog box.
varguments
Optional parameter, type: Variant. Used to pass parameters to the dialog box. There are no limits on the types of arguments passed, including arrays. The dialog box uses window.dialogarguments to get the arguments passed in.
sfeatures
Optional parameter, type: String. Used to describe the appearance of the dialog box and other information, you can use the following one or several, with a semicolon ";" Separated.
Dialogheight dialog height, not less than 100px,ie4 in dialogheight and dialogwidth the default unit is EM, and IE5 is PX, for easy to see, in the definition of modal Mode dialog box, use PX to do the unit.
Dialogwidth: The width of the dialog box.
Dialogleft: The distance from the desktop to the left.
Dialogtop: The distance from the desktop.
Center: {yes | no | 1 | 0}: The window is centered, the default is yes, but you can still specify the height and width.
Help: {yes | no | 1 | 0}: Whether the assist button is displayed, default yes.
Resizable: {yes | no | 1 | 0} [ie5+]: Whether the size can be changed. Default No.
Status: {yes | no | 1 | 0} [ie5+]: Whether the status bar is displayed. Default is yes[Modeless] or no[modal].
       scroll:{Yes | no | 1 | 0 | on | off}: Indicates whether the dialog box displays a scroll bar. The default is yes.


Example: (flashing after opening the form disappears)

Code
<script language= "JavaScript" >
function Openwin ()
{
Window.showmodelessdialog (' myttt.html ', ' ', ' dialogwidth:1px;dialogheight:1px;dialogtop:1;dialogleft:1; ');
Document.all.a1.focus ();
}

Call
<body onload= "Openwin (); > or

<asp:linkbutton id= "LinkButton1" runat= "Server" onclientclick= "Openwin ()" >LinkButton</asp:LinkButton>

Three. window.showModalDialog usage

Example:

Code
<script language= "JavaScript" >
function Openwin ()
{
window.showModalDialog (' myttt.html ', ' ', ' dialogwidth:1px;dialogheight:1px;dialogtop:1;dialogleft:1; ');
Document.all.a1.focus ();
}

Call
<body onload= "Openwin (); > or

<asp:linkbutton id= "LinkButton1" runat= "Server" onclientclick= "Openwin ()" >linkbutton</asp:linkbutton

What's the difference between ShowModalDialog and showModelessDialog?
ShowModalDialog: The input focus is always maintained when it is opened. The user cannot switch to the main window unless the dialog box is closed. The effect is similar to alert operation.
showModelessDialog: After being opened, the user can randomly switch the input focus. No effect on the main window (up to the block)

How do I eject a Web form of a certain size?

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.