<%@ page language=
"java"
import
=
"java.util.*"
pageEncoding=
"gb2312"
%>
<%
@page
import
=
"java.util.*"
%>
<html>
<head>
<style type=
"text/css"
>
#winpop { width:350px; height:0px; position:absolute; right:
0
; bottom:
0
; border:1px solid grey; margin:
0
; padding:1px; overflow:hidden; display:none; background:#FFFFFF}
#winpop .title { width:
100
%; height:30px; line-height:
200
%; background:#7dda1a ; font-weight:bold; text-align:center; font-size:14px;color:white}
#winpop .con { width:
100
%; height:360px; line-height:80px; font-weight:bold; font-size:12px; color:#FF0000; text-decoration:underline; text-align:center}
.close { position:absolute; right:4px; top:-1px; color:#FFFFFF; cursor:pointer}
</style>
</head>
<%
List<Map> unreadList =
new
ArrayList<Map>();
Map<String,String> map1=
new
HashMap<String,String>();
map1.put(
"msgId"
,
"1"
);
map1.put(
"msgContent"
,
"关于国庆放假的通知"
);
unreadList.add(map1);
Map<String,String> map2=
new
HashMap<String,String>();
map2.put(
"msgId"
,
"2"
);
map2.put(
"msgContent"
,
"祝大家国庆快乐!"
);
unreadList.add(map2);
int
num=unreadList.size();
%>
<body>
<script language=
"javascript"
type=
"text/javascript"
>
window.onload = function tanchuang() {
document.getElementById(
'winpop'
).style.height =
'0px'
;
setTimeout(
"tips_pop()"
,
0
);
}
function tips_pop() {
var MsgPop = document.getElementById(
"winpop"
);
var popH = parseInt(MsgPop.style.height);
if
(popH ==
0
) {
MsgPop.style.display =
"block"
;
show = setInterval(
"changeH('up')"
,
30
);
}
else
{
hide = setInterval(
"changeH('down')"
,
30
);
}
}
function changeH(str) {
var MsgPop = document.getElementById(
"winpop"
);
var popH = parseInt(MsgPop.style.height);
if
(str ==
"up"
) {
if
(popH <=
200
) {
MsgPop.style.height = (popH +
4
).toString() +
"px"
;
}
else
{
clearInterval(show);
}
}
if
(str ==
"down"
) {
if
(popH >=
4
) {
MsgPop.style.height = (popH -
4
).toString() +
"px"
;
}
else
{
clearInterval(hide);
MsgPop.style.display =
"none"
;
}
}
}
</script>
<%
if
(num>
0
){ %>
<div id=
"winpop"
>
<div
class
=
"title"
>系统信息(<%=num %>)<br>
<span
class
=
"close"
onclick=
"tips_pop()"
>关闭</span></div>
<%
for
(
int
i=
0
;i<num;i++) { %>
<!-- 点击信息标题链接到信息明细,传递信息编号参数 -->
<a href=
"/XXXAction.do?msgId=<%=unreadList.get(i).get("
msgId
") %>"
>
<%
if
(String.valueOf(unreadList.get(i).get(
"msgContent"
)).length()>
16
) {%>
<%=String.valueOf(unreadList.get(i).get(
"msgContent"
)).substring(
0
,
16
)+
"..."
%>
<%}
else
{ %>
<%=String.valueOf(unreadList.get(i).get(
"msgContent"
)) %>
<%} %>
</a><br>
<%
if
(i>=
1
){
break
;
}
} %>
<center>
<!-- 点击查看更多未读消息 -->
<a href=
"/XXXAction.do %>"
><font color=
"red"
>更多未读消息...</font></a></center>
</div>
<%} %>
</body>
</html>