Skip navigation.

exploreopera

| Help

Sign up | Help

Modal Windows in Opera (JavaScript)

I wonder if Opera could add a window.showModalDialog() function?

I know it's an IE / Mozilla steal but would be useful.

At the moment, Opera provides no way of showing a window modally. You have to just settle for a non modal window, as shown in this code:


function modalWin() {
if (window.showModalDialog) {
window.showModalDialog('popup.htm','_blank','dialogWidth:255px;dialogHeight:250px');
} else {
window.open('popup.htm','_blank', 'height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes');
}
}


I wonder if Opera would be interested in creating this function in Opera? It's definately something I'd find useful and it saves a lot of hassle working around Opera and Netscape. (If Opera supports it, that's good enough to ignore NS!)

This is no doubt first of many blog posts I will make under the "Opera wishlist" tag.

This new HitsLink thingymajigEverything should be zero based

Comments

avatar
I've made this script to emulate a modal window:

http://my.opera.com/leoalassia/blog/2008/08/07/showmodaldialog-for-opera

By leoalassia, # 7. August 2008, 23:01:07

Write a comment

You must be logged in to write a comment. if you're not a registered member, please sign up.