87,910
社区成员
发帖
与我相关
我的任务
分享
<script type="text/javascript">
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 sFeatures="dialogHeight: " + iHeight + "px;";
return sFeatures;
}
function fnOpen(){
var sFeatures=fnSetValues();
window.showModalDialog("ie7.aspx", "",
sFeatures)
}
</script>
<form name="oForm">
Dialog Height
<select name="oHeight">
<option>-- 随机 --</option>
<option>150</option>
<option>200</option>
<option>250</option>
<option>300</option>
</select>
Create Modal Dialog Box
<input type="button" value="测试" onclick="fnOpen()">
</form>