Wednesday, December 14, 2011

Open Modal Popup in different Browsers



In Windows Internet Explorer supports a direct method to open a modal pop using

window.showModalDialog("popupModel.html") ;

method.

To get more information on window.showModalDialog(xxxxxxxxxxx)  visit:
 http://fromdotnet.blogspot.com/2011/09/call-parent-window-methods-form-dialog.html

We have one advantage with showModalDialog that we can pass arguments to Modal popup.

But other Browser doesnt support it and they have there own way to implement it by passing an additonal property model=yes with Window.Open() method.

window.open('popupModal.html','name',
'height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes');

Example:
function popupModalWin() {
if (window.showModalDialog) {
var
window.showModalDialog("popupModelWindow.htm",,"popupModelWindowName",
"dialogWidth:255px;dialogHeight:250px");
}
else {
window.open(popupModelWindow.htm','popupModelWindowName',
'height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes');
}
}



Happy Living...
Happy Coding...
Happy Concepts....

No comments:

Post a Comment