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

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42
