<script type="text/javascript">
window.onload=function()
{
var divTip = document.createElement("div");
divTip.id="tip";
divTip.innerHTML="<h1><a href='javascript:void(0)' onclick='start()'>×</a>您有1條新消息</h1><p><a href='javascript:void(0)' onclick='showwin()'>點擊這里查看詳細(xì)</a></p>";
divTip.style.height='0px';
divTip.style.bottom='0px';
divTip.style.position='fixed';
document.body.appendChild(divTip);
start();
}
var handle;
function start(count)//參數(shù)為新短信個數(shù)
{
var obj = document.getElementById("tip");
obj.innerHTML=obj.innerHTML.replace("msgCount",count);
if (parseInt(obj.style.height)==0)
{ obj.style.display="block";
handle = setInterval("changeH('up')",20); //調(diào)用該方法 參數(shù)為循環(huán)調(diào)用的時間
}else
{
handle = setInterval("changeH('down')",20)
}
}
function changeH(str)//逐步改變窗體的高一次遞增 或 遞減8px
{
var obj=document.all?document.all["tip"] : document.getElementById("tip");
if(str=="up")
{
if (parseInt(obj.style.height)>100)
clearInterval(handle);
else
obj.style.height=(parseInt(obj.style.height)+8).toString()+"px";
}
if(str=="down")
{
if (parseInt(obj.style.height)<8)
{
clearInterval(handle);
obj.style.display="none";
}
else
obj.style.height=(parseInt(obj.style.height)-8).toString()+"px";
}
function showwin()
{
document.getElementsByTagName("html")[0].style.overflow = "hidden";
start();
window.open("/member/managemsg.aspx");
}
</script>