始终在最前面的弹出窗口对话框<转>
1
<html>
2
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
5
<title>网页特效代码|JsCode.CN|---始终在最前面的弹出窗口对话框</title>
6
</head>
7
8
<body>
9
<SCRIPT>
10
function fnRandom(iModifier){
11
return parseInt(Math.random()*iModifier);
12
}
13
function fnSetValues(){
14
var iHeight=oForm.oHeight.options[
15
oForm.oHeight.selectedIndex].text;
16
if(iHeight.indexOf("Random")>-1){
17
iHeight=fnRandom(document.body.clientHeight);
18
}
19
var sFeatures="dialogHeight: " + iHeight + "px;";
20
return sFeatures;
21
}
22
function fnOpen(){
23
var sFeatures=fnSetValues();
24
window.showModalDialog("showModalDialog_target.htm", "",
25
sFeatures)
26
}
27
</SCRIPT>
28
<FORM NAME=oForm>
29
窗口高度: <SELECT NAME="oHeight">
30
<OPTION>-- 随机 --
31
<OPTION>150
32
<OPTION>200
33
<OPTION>250
34
<OPTION>300
35
</SELECT>
36
打开窗口:
37
<INPUT TYPE="button" VALUE="打开窗口"
38
onclick="fnOpen()">
39
</FORM>
40
</body>
41
42
</html>
效果演示http://www.jscode.cn/JsHtml/Js659.htm
<html>2

3
<head>4
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">5
<title>网页特效代码|JsCode.CN|---始终在最前面的弹出窗口对话框</title>6
</head>7

8
<body>9
<SCRIPT>10
function fnRandom(iModifier){11
return parseInt(Math.random()*iModifier);12
}13
function fnSetValues(){14
var iHeight=oForm.oHeight.options[15
oForm.oHeight.selectedIndex].text;16
if(iHeight.indexOf("Random")>-1){17
iHeight=fnRandom(document.body.clientHeight);18
}19
var sFeatures="dialogHeight: " + iHeight + "px;";20
return sFeatures;21
}22
function fnOpen(){23
var sFeatures=fnSetValues();24
window.showModalDialog("showModalDialog_target.htm", "",25
sFeatures)26
}27
</SCRIPT>28
<FORM NAME=oForm>29
窗口高度: <SELECT NAME="oHeight">30
<OPTION>-- 随机 --31
<OPTION>15032
<OPTION>20033
<OPTION>25034
<OPTION>30035
</SELECT>36
打开窗口:37
<INPUT TYPE="button" VALUE="打开窗口"38
onclick="fnOpen()">39
</FORM>40
</body>41

42
</html>



浙公网安备 33010602011771号