Modal and Modeless Dialog Boxes: Setting the Window's Ornaments - Doc JavaScript
Modal and Modeless Dialog Boxes
Setting the Window's Ornaments
Size and position are not the only parameters that can be used to determine the window's look. A window's look is affected by other ornaments such as its edge style, whether it does or does not have scrollbars, and whether it does or does not display the context-sensitive Help icon. You can also make the window resizeable.
You have probably noticed that the window you opened is not resizeable. This is a default behavior you can change. Simply set the resizable
parameter to yes
. Pop up a resizeable window created with this invocation:
window.showModalDialog('5.html','','resizable:yes');
Play around with it and prove to yourself that indeed the window is resizeable. The possible values of the resizable
property are: yes
, no
, 1
, 0
, on
, and off
. Their semantics are intuitive.
The default edge
style of a dialog window is raised
. Let's pop up two modeless dialog boxes so we can compare their edges. Pop up here the raised-edge window, defined as:
window.showModelessDialog('5.html','', 'edge:raised;dialogLeft:500');
Pop up here the sunken-style box, defined as:
window.showModelessDialog('5.html','', 'edge:sunken;dialogLeft:100');
Again, the only way to pop up two dialog boxes is to have the first one be generated by the showModelessDialog()
function. Here, we used this function for both windows in order to let you play around with them.
By default, a dialog box displays the context-sensitive Help icon on one of the top corners. To remove it, set help
to no
:
window.showModalDialog('5.html','','help:no');
The possible values of the help
property are: yes
, no
, 1
, 0
, on
, and off
. Their semantics are intuitive.
By default, a dialog box pops up with scrollbars, if needed. You can remove them by setting scroll
to no
:
window.showModalDialog('5.html','','scroll:no');
Of course, you have to be aware of the consequences for not having scrollbars of not being able to scroll down the document. The possible values of the scroll
property are: yes
, no
, 1
, 0
, on
, and off
. Their semantics are intuitive.
Next: How to impact the trusted application's dialog boxes
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: August 13, 2001
Revised: August 13, 2001
URL: https://www.webreference.com/js/column90/5.html