简体   繁体   中英

Restricting access to the other open browser

I have requirement where I need to open a popup on click of a button. This works fine, but the pop up window goes behind the opened browser. I want to restrict access to the other opened browser window until the complete transaction in the newly opened window is done.

In order to open a new window I am using the following code.

Response.Write("detailedresults=window.open('NewWindow.aspx','Send Data','left=(screen.width) ? (screen.width - 800) / 2 : 0,top=(screen.height) ? (screen.height - 700) / 2 : 0, width=1000, height=500, toolbar=no, menubar=no, titlebar=no, location=no, addressbar=no');");

I would use a modal dialog for this instead of a popup. One, modal dialogs are less intrusive to other tabs that might be open, and two, they typically include a semi-transparent overlay layer covering the main window to restrict access as you requested. Here is an example from jQuery UI:

http://jqueryui.com/dialog/#modal-confirmation

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