I want open window.open
as modal popup.
var features = 'resizable= yes; status= no; scroll= no; help= no; center= yes;
width=460;height=140;menubar=no;directories=no;location=no;modal=yes';
window.open(href, 'name', features, false);
I can use Window.ShowModelDialog()
, but in my child window I am calling parent javascript method. That is not happening with ShowModelDialog().
function CallParentScript(weburl) {
alert(weburl);
if (weburl != null) {
var url = weburl;
window.opener.SelectUserImageCallback(url);
window.close();
return false;
}
}
If I use window.open()
. I can call Parent javascript. But window is not modal.
How to solve this? Can I write something in child popup to always top?
I agree with both previous answers. Basically, you want to use what is known as a "lightbox" - http://en.wikipedia.org/wiki/Lightbox_(JavaScript)
It is essentially a div than is created within the DOM of your current window/tab. In addition to the div that contains your dialog, a transparent overlay blocks the user from engaging all underlying elements. This can effectively create a modal dialog (i.e. user MUST make some kind of decision before moving on).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With