今天花了一个下午的时间作的。
模仿“网易邮箱”的提示层功能。
个人爱好,同时也是为了送网友的公司http://www.oblog.cn一个礼物。不知道他是否用的上。
下载地址:
https://files.cnblogs.com/amushen/popAlert.rar
");
37
win.document.body.style.backgroundColor="transparent";
38
39
document.body.style.overflow="hidden";
40
41
var pBody=win.document.body.children[1];
42
var pBg=win.document.body.children[0];
43
hideAllSelect();
44
initBg(pBg);
45
initBody(pBody,info);
46
}
47
48
/**
49
* 描述:初始化背景层
50
* 作者:申楠
51
* 参数: obj;背景层
52
* 返回: 无
53
* 日期:2005-10-25
54
*/
55
function initBg(obj){
56
with(obj.style){
57
position="absolute";
58
left="0";
59
top="0";
60
width="100%";
61
height="100%";
62
visibility="hidden";
63
backgroundColor="#333333";
64
filter="blendTrans(duration=1) alpha(opacity=60)";
65
}
66
67
if (obj.filters.blendTrans.status != 2) {//no playing
68
obj.filters.blendTrans.apply();
69
obj.style.visibility="visible";
70
obj.filters.blendTrans.play();
71
}
72![]()
73![]()
74
}
75
/**
76
* 描述:初始化显示层
77
* 作者:申楠
78
* 参数: obj;显示层;info:显示内容;winName :the name of the iframe
79
* 返回: 无
80
* 日期:2005-10-25
81
*/
82
function initBody(obj,info){
83
with(obj.style){
84
position="absolute";
85
width="400";
86
height="150";
87
backgroundColor="#ffffff";
88
}
89
obj.style.left=window.document.body.clientWidth/2-200;
90
obj.style.top=window.document.body.clientHeight/3;
91
var str;
92
str="
";
93
str+="
:::提示:::![]()
";
94
str+=" ";
95
str+=info+"
";
96
obj.innerHTML=str;
97
}
98
99
/**
100
* 描述:关闭一切
101
* 作者:申楠
102
* 参数: obj :the iframe 's name
103
* 返回: 无
104
* 日期:2005-10-25
105
*/
106
function closeWin(){
107
ifm.style.visibility="hidden";
108
showAllSelect();
109
document.body.style.overflow="auto";
110
}
111
/**
112
* describe:hide all select
113
* author:shennan
114
* params:
115
* return:
116
* date:2005-10-25
117
*/
118
function hideAllSelect(){
119
var obj;
120
obj=document.getElementsByTagName("SELECT");
121
var i;
122
for(i=0;i<obj.length;i++)
123
obj[i].style.visibility="hidden";
124
}
125
function showAllSelect(){
126
var obj;
127
obj=document.getElementsByTagName("SELECT");
128
var i;
129
for(i=0;i<obj.length;i++)
130
obj[i].style.visibility="visible";
131
}
132![]()
37
win.document.body.style.backgroundColor="transparent";38
39
document.body.style.overflow="hidden";40
41
var pBody=win.document.body.children[1];42
var pBg=win.document.body.children[0]; 43
hideAllSelect();44
initBg(pBg); 45
initBody(pBody,info); 46
}47
48
/**49
* 描述:初始化背景层50
* 作者:申楠51
* 参数: obj;背景层52
* 返回: 无53
* 日期:2005-10-2554
*/55
function initBg(obj){56
with(obj.style){57
position="absolute"; 58
left="0";59
top="0";60
width="100%";61
height="100%";62
visibility="hidden";63
backgroundColor="#333333";64
filter="blendTrans(duration=1) alpha(opacity=60)";65
}66
67
if (obj.filters.blendTrans.status != 2) {//no playing68
obj.filters.blendTrans.apply();69
obj.style.visibility="visible";70
obj.filters.blendTrans.play();71
}72

73

74
}75
/**76
* 描述:初始化显示层77
* 作者:申楠78
* 参数: obj;显示层;info:显示内容;winName :the name of the iframe79
* 返回: 无80
* 日期:2005-10-2581
*/82
function initBody(obj,info){83
with(obj.style){84
position="absolute";85
width="400";86
height="150";87
backgroundColor="#ffffff"; 88
}89
obj.style.left=window.document.body.clientWidth/2-200;90
obj.style.top=window.document.body.clientHeight/3;91
var str;92
str="93
str+="
:::提示:::
94
str+="95
str+=info+"";
96
obj.innerHTML=str;97
}98
99
/**100
* 描述:关闭一切101
* 作者:申楠102
* 参数: obj :the iframe 's name 103
* 返回: 无104
* 日期:2005-10-25105
*/106
function closeWin(){107
ifm.style.visibility="hidden"; 108
showAllSelect();109
document.body.style.overflow="auto"; 110
}111
/**112
* describe:hide all select113
* author:shennan114
* params:115
* return:116
* date:2005-10-25117
*/118
function hideAllSelect(){119
var obj;120
obj=document.getElementsByTagName("SELECT");121
var i;122
for(i=0;i<obj.length;i++)123
obj[i].style.visibility="hidden";124
}125
function showAllSelect(){126
var obj;127
obj=document.getElementsByTagName("SELECT");128
var i;129
for(i=0;i<obj.length;i++)130
obj[i].style.visibility="visible";131
}132


浙公网安备 33010602011771号