<HTML
<HEAD
<TITLEshowModalDialog
方法</TITLE
<meta
HTTP-EQUIV="Content-Type"
content="text/html;charset=gb_2312-80"
<style
body,TD
{FONT-SIZE:
9pt}
</style
<SCRIPT
function
fnRandom(iModifier){
return
parseInt(Math.random()*iModifier);
}
function
fnSetValues(){
var
iHeight=oForm.oHeight.options[oForm.oHeight.selectedIndex].text;
if(iHeight.indexOf("Random")-1){
iHeight=fnRandom(document.body.clientHeight);
}
var
iWidth=oForm.oWidth.options[oForm.oWidth.selectedIndex].text;
if(iWidth.indexOf("Random")-1){
iWidth=fnRandom(document.body.clientWidth);
}
var
iTop=oForm.oTop.options[oForm.oTop.selectedIndex].text;
if(iTop.indexOf("Random")-1){
iTop=fnRandom(screen.height);
}
var
iLeft=oForm.oLeft.options[oForm.oLeft.selectedIndex].text;
if(iLeft.indexOf("Random")-1){
iLeft=fnRandom(screen.width);
}
var
sEdge=oForm.oEdge.options[oForm.oEdge.selectedIndex].text;
var
bCenter=oForm.oCenter.options[oForm.oCenter.selectedIndex].text;
var
bHelp=oForm.oHelp.options[oForm.oHelp.selectedIndex].text;
var
bResize=oForm.oResize.options[oForm.oResize.selectedIndex].text;
var
bStatus=oForm.oStatus.options[oForm.oStatus.selectedIndex].text;
var
sFeatures="dialogHeight:
"
+
iHeight
+
"px;
dialogWidth:
"
+
iWidth
+
"px;
dialogTop:
"
+
iTop
+
"px;
dialogLeft:
"
+
iLeft
+
"px;
edge:
"
+
sEdge
+
";
center:
"
+
bCenter
+
";
help:
"
+
bHelp
+
";
resizable:
"
+
bResize
+
";
status:
"
+
bStatus
+
";";
return
sFeatures;
}
function
fnOpen(){
/*
The
method
constructor
looks
like:
showModalDialog(
sURL="The
page
that
is
opened"
sArguments="Extra
values
or
object
references"
sFeatures="features
of
the
window";
)
*/
var
sFeatures=fnSetValues();
oFeatures.innerHTML=''window.showModalDialog("SMD_target.htm","''
+
oForm.oArguments.value
+
''","''
+
sFeatures
+
''");'';
window.showModalDialog("SMD_target.htm",
oForm.oArguments.value,
sFeatures)
}
</SCRIPT
<!--
SAMPLE_STYLE_START
--
<LINK
REL="stylesheet"
HREF="/workshop/basicSDKIE4.css"
TYPE="text/css"
<!--
SAMPLE_STYLE_END
--
</HEAD
<!--TOOLBAR_START--
<!--TOOLBAR_EXEMPT--
<!--TOOLBAR_END--
<BODY
TOPMARGIN=0
LEFTMARGIN=0
BGPROPERTIES="FIXED"
BGCOLOR="#FFFFFF"
LINK="#000000"
VLINK="#808080"
ALINK="#000000"
<BLOCKQUOTE
CLASS="body"
<H1showModalDialog
用法</H1
<FORM
NAME="oForm"
<FIELDSET<LEGEND<bshowModalDialog
Method
Options</b</LEGEND
<TABLE
<TR<TD<LABEL
FOR=dHeightDialog窗口高度(数字)</LABEL</TD<TD<SELECT
ID="dHeight"
NAME=oHeight<OPTION--
Random
--<OPTION150<OPTION200<OPTION
250<OPTION300<OPTION400<OPTION500</SELECT</TD</TR
<TR<TD<LABEL
FOR=dWidthDialog窗口宽度(数字)</LABEL</TD<TD<SELECT
ID="dWidth"
NAME=oWidth<OPTION--
Random
--<OPTION150<OPTION200<OPTION
250<OPTION300<OPTION400<OPTION500</SELECT</TD</TR
<TR<TD<LABEL
FOR=dTopDialog
窗口上距离(数字)</LABEL</TD<TD<SELECT
ID="dTop"
NAME=oTop<OPTION--
Random
--<OPTION150<OPTION200<OPTION250
<OPTION300<OPTION400<OPTION500<OPTION</SELECT</TD</TR
<TR<TD<LABEL
FOR=dLeftDialog
窗口左距离(数字)</LABEL</TD<TD<SELECT
ID="dLeft"
NAME=oLeft<OPTION--
Random
--<OPTION150<OPTION200<OPTION
250<OPTION300<OPTION400<OPTION500<OPTION</SELECT</TD</TR
<TR<TD<LABEL
FOR=dCenterDialog
窗口是否居中(YES时窗口左距离不能赋值}
</LABEL</TD<TD<SELECT
ID="dCenter"
NAME=oCenter<OPTIONYes<OPTIONNo
</SELECT</TD</TR
<TR<TD<LABEL
FOR=dEdgeDialog
样式</LABEL</TD<TD<SELECT
ID="dEdge"
NAME=oEdge<OPTIONRaised<OPTIONSunken</SELECT</TD</TR
<TR<TD<LABEL
FOR=dHelpDialog
窗口是否显示帮助按钮</LABEL</TD<TD
<SELECT
ID="dHelp"
NAME=oHelp<OPTIONYes<OPTIONNo</SELECT</TD</TR
<TR<TD<LABEL
FOR=dResizeDialog
窗口是否可控制大小</LABEL</TD<TD
<SELECT
ID="dResize"
NAME=oResize<OPTIONYes<OPTIONNo</SELECT</TD</TR
<TR<TD<LABEL
FOR=dStatusDialog
窗口是否显示状态栏</LABEL</TD<TD
<SELECT
ID="dStatus"
NAME=oStatus<OPTIONYes<OPTIONNo</SELECT</TD</TR
<TR<TD<LABEL
FOR=dArgumentsDialog
窗口的标题</LABEL</TD<TD<INPUT
TYPE=text
NAME=oArguments
ID="dArguments"
VALUE="Dialog
窗口标题"</TD</TR
<TR<TD<LABEL
FOR=dCommand建立
Dialog
窗口</LABEL</TD<TD<INPUT
ID="dCommand"
NAME=oCommand
TYPE=button
VALUE="建立窗口"
onclick="fnOpen()"</TD</TR
<TR<TD<b代码:</b</TD<TD
ID=oFeatures</TD</TR
<TR<TD<b注意:</b</TD<TD*
只支持IE
5
以上的版本.</TD</TR
</TABLE
</FORM
</BLOCKQUOTE
</BODY
</HTML