- 热门文章:
- · 三级下拉框连动的数据库版!
- · 给一个类增加属性和方法?看看这个够不够?
- · 在网页中实现OICQ里的头像选择的下拉框 (附例子)
- · 请看用javascript设置和读取cookie的简单例子.....
- · 请看被打开的子窗口继承父窗口定义的styleSheets的例子
- · 经常有人询问如何用javascript判断日期是否有效,我以前也遇到过,不过后来得高人指点解决了,贴出来大...
- · ShowModalDialog的具体用法
- · 下拉式互动列表框(EC潮流网同学录之真情留言板使用的代码)
- · MSGBOX返回值
- · js中几种去掉字串左右空格的方法,请看
- · VBSctipt 5.0中的新特性
- · Jscript 5.0中的新特性
上一篇:一个鼠标自动移动的js例子! >>
window.showModalDialog()中有三个参数,各有什么用,请举例!
------<br>
Creates a modal dialog box that displays the specified HTML document.<br>
<br>
Syntax<br>
<br>
vReturnValue = window.showModalDialog(sURL [, vArguments] [, sFeatures])<br>
Parameters<br>
<br>
sURL Required. String that specifies the URL of the document to load and display. <br>
vArguments Optional. Variant that specifies the arguments to use when displaying the document. Use this parameter to pass a value of any type, including an array of values. The dialog box can extract the values passed by the caller from the dialogArguments property of the window object. <br>
sFeatures Optional. String that specifies the window ornaments for the dialog box, using one or more of the following semicolon-delimited values: dialogHeight:sHeight Sets the height of the dialog window (see Remarks for default unit of measure). <br>
dialogLeft:sXPos Sets the left position of the dialog window relative to the upper-left corner of the desktop. <br>
dialogTop:sYPos Sets the top position of the dialog window relative to the upper-left corner of the desktop. <br>
dialogWidth:sWidth Sets the width of the dialog window (see Remarks for default unit of measure). <br>
center:{ yes | no | 1 | 0 | on | off } Specifies whether to center the dialog window within the desktop. The default is yes. <br>
dialogHide:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window is hidden when printing or using print preview. This feature is only available when a dialog box is opened from a trusted application. The default is no. <br>
edge:{ sunken | raised } Specifies the edge style of the dialog window. The default is raised. <br>
help:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays the context-sensitive Help icon. The default is yes. <br>
resizable:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window has fixed dimensions. The default is no. <br>
scroll:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays scrollbars. The default is yes. <br>
status:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays a status bar. The default is yes for untrusted dialog windows and no for trusted dialog windows. <br>
unadorned:{ yes | no | 1 | 0 | on | off } Specifies whether the dialog window displays the border window chrome. This feature is only available when a dialog box is opened from a trusted application. The default is no. <br>
<br>
<br>
Return Value<br>
<br>
Variant. Returns the value of the returnValue property as set by the window of the document specified in sURL .<br>
<br>
Remarks<br>
<br>
A modal dialog box retains the input focus while open. The user cannot switch windows until the dialog box is closed.<br>
<br>
Because a modal dialog box can include a URL to a resource in a different domain, do not pass information through the vArguments parameter that the user might consider private. The vArguments parameter can be referenced within the modal dialog box using the dialogArguments property of the window object. If the vArguments parameter is defined as a string, the maximum string length that can be passed to the modal dialog box is 4096 characters; longer strings are truncated.<br>
<br>
As of Microsoft® Internet Explorer 4.0, you can eliminate scroll bars on dialog boxes. To turn off the scroll bar, set the SCROLL attribute to false in the body element for the dialog window, or call the modal dialog box from a trusted application.<br>
<br>
Internet Explorer 5 allows further control over modal dialog boxes through the status and resizable values in the sFeatures parameter of the showModalDialog method. Turn off the status bar by calling the dialog box from a trusted application, such as Microsoft® Visual Basic® or an HTML Application (HTA), or from a trusted window, such as a trusted modal dialog box. These applications are considered to be trusted because they use Internet Explorer interfaces instead of the browser. Any dialog box generated from a trusted source has the status bar turned off by default. Resizing is turned off by default, but you can turn it on by specifying resizable=yes in the sFeatures string of the showModalDialog method.<br>
<br>
You can set the default font settings the same way you set Cascading Style Sheets (CSS) attributes (for example, "font:3;font-size:4"). To define multiple font values, use multiple font attributes.<br>
<br>
The default unit of measure for dialogHeight and dialogWidth in Internet Explorer 4.0 is the pixel; in Internet Explorer 5 it is the em. The value can be an integer or floating-point number, followed by an absolute units designator (cm, mm, in, pt, pc, or px) or a relative units designator (em or ex). For consistent results, specify the dialogHeight and dialogWidth in pixels when designing modal dialog boxes.<br>
<br>
Although a user can manually adjust the height of a dialog box to a smaller value —provided the dialog box is resizable —the minimum dialogHeight you can specify is 100 pixels.<br>
<br>
To override center, even though the default for center is yes, you can specify either dialogLeft and/or dialogTop.<br>
<br>
Examples<br>
<br>
This example uses the showModalDialog method to open a customized dialog box.<br>
<br>
<SCRIPT><br>
function fnRandom(iModifier){<br>
return parseInt(Math.random()*iModifier);<br>
}<br>
function fnSetValues(){<br>
var iHeight=oForm.oHeight.options[<br>
oForm.oHeight.selectedIndex].text;<br>
if(iHeight.indexOf("Random")>-1){<br>
iHeight=fnRandom(document.body.clientHeight);<br>
}<br>
var sFeatures="dialogHeight: " + iHeight + "px;";<br>
return sFeatures;<br>
}<br>
function fnOpen(){<br>
var sFeatures=fnSetValues();<br>
window.showModalDialog("showModalDialog_target.htm", "", <br>
sFeatures)<br>
}<br>
</SCRIPT><br>
<br>
<FORM NAME=oForm><br>
Dialog Height <SELECT NAME="oHeight"><br>
<OPTION>-- Random --<br>
<OPTION>150<br>
<OPTION>200<br>
<OPTION>250<br>
<OPTION>300<br>
</SELECT><br>
<br>
Create Modal Dialog Box<br>
<INPUT TYPE="button" VALUE="Push To Create" <br>
onclick="fnOpen()"><br>
</FORM><br>
Show Me<br>
Below is an extended version of the above script, which demonstrates many of the features available for creating a custom dialog box. <br>
<br>
Show Me<br>
Standards Information<br>
<br>
There is no public standard that applies to this method.
下一篇:三级下拉框连动的数据库版! >>
相关文章:
- · 加快 DHTML 的一组技巧(Copy from Microsoft)
- · 一个不太让人讨厌的自动弹出窗口:)
- · 一个把数字转英文的实用程序
- · rollarea.js及其用法示例
- · 下拉框连动的小例子(.htm版)
- · 判断访问者的浏览器是否支持javascript和Cookies
- · 在Windows桌面上使用WSH接收邮件 (转)
- · HTML4.0的 Access Key
- · 绝对是好东西 (select1 <==> select2):
- · 一个类似vbscript的round函数的javascript函数
- · 用javascript检查yyyy-mm-dd格式的正确源码。
- · HEAD元素使用集锦 (转)
- · 脚本控制Frame (转)
- · vbscript错误代码及对应解释大全
- · jscript错误代码及相应解释大全
- · 打开最大化窗口的一点经验
- · 无偿贡献,进入页面后自动刷新一次
- · 庆祝 Joy ASP 上贴数超过800页!!! 送给大家一个小礼物 ^_^
- · 自己动手,结合javascript和dhtml做一个ubb编辑器(附例子代码)
- · 选择最快的镜像站点
- · 一段有趣并且实用的程序--利用javascript和dhtml实现两个列表框中内容的移动。(代码见内,把它存为一个...
- · 动态菜单的另一种实现(一) category.js
- · 动态数组的另一种实现(二) 界面
- · 实际使用“DXML”:在站点上实现 DHTML 菜单和目录(co.)
- · 以前收集的一些资料---JS中处理日期的一些函数和方法
- · 以前搜集的一些资料---html中的特殊字符(2)
- · 以前搜集的一些资料---html中的特殊字符(1)
- · 在浏览器里实现类似VB Form的界面控制
- · CSS2参考之一(转贴)
- · CSS2参考之二(转贴)
- · CSS2参考之三(转贴)
- · CSS2参考之四(转贴)
- · CSS2参考之五(转贴)
- · CSS2参考之六(转贴)
- · CSS2参考之七(转贴)
- · CSS2参考之八(转贴)
- · CSS2参考之九(转贴)
- · CSS2参考之十一(转贴)<完>
