简体   繁体   中英

Customizing popup window with window.open

I need to open a number of pop up windows on click of Hyper link on a page, for this reason I have to go for Window.open instead of showModalDialog function.

But i see that using Window.open the look is not good enough. (Basically i want to disable the url window and add all my stuff there )

Please tell me if this is possible with window.open??

Or please suggest me what is the best approach in this case??

You can specify what featured you want on your popup windows using the third argument to window.open :

strWindowFeatures
Optional parameter. This parameter is the string which lists the requested window features (window functionalities and toolbars) of the new browser window. This string parameter must not contain any blank space. Each requested window feature must be separated by a comma inside the character string.

The page I linked to even has a diagram to help you sort out which features are which.

myRef = window.open('win','mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0');

visit w3c for the complete list and browser compability

There are many customizations that you can introduce.

If you simply want to disable the toolbar, menubar, and address fields, do this:

window.open('','','menubar=no,toolbar=no,location=no');

See the full list of customizable options here: http://www.w3schools.com/jsref/met_win_open.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM