从下向上弹出窗口(像MSN一样有新消息)

var NotationMsg='提示信息';  //定义提示信息
//添加隐藏层

var div=document.createElement('div');
div.id='Notation';
var str_N='<table id="NotationTable" style="width:100%"><tr>'+'<td>'+NotationMsg+'</td><td align="right"><img src="../images/msgClose.jpg" hspace="3" style="CURSOR:pointer" οnclick="parent.closeDiv()" title="关闭"/></td></tr></table>';
str_N+=('<table width="100%"><tr><td style="height:60px;vertical-align:center;text-align:center;word-break:break-all">有新的申请需要您审核</td></tr></table>');
var frm=document.createElement('<iframe name="NotationFrm" frameborder=0 marginheight=0 marginwidth=0 hspace=0 vspace=0 scrolling=no style="width:180px;height:116px"></iframe>');
div.appendChild(frm);
document.body.appendChild(div);
window.frames["NotationFrm"].document.write('<head><LINK href="../Styles/StyleNew.css" type="text/css" rel="stylesheet"></head>'+'<body>'+str_N+'</body>');

var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
         function getMsg()
  {
      //alert(div.outerHTML);
                       
   try{
   //window.open("Top.aspx","TopMusic");
   divTop = parseInt(document.getElementById("Notation").style.top,10)
   divLeft = parseInt(document.getElementById("Notation").style.left,10)
   divHeight = parseInt(document.getElementById("Notation").offsetHeight,10)
   divWidth = parseInt(document.getElementById("Notation").offsetWidth,10)
   docWidth = document.body.clientWidth;
   docHeight = document.body.clientHeight;
   document.getElementById("Notation").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;//  divHeight
   document.getElementById("Notation").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth-20
   document.getElementById("Notation").style.visibility='visible'
   objTimer = window.setInterval("moveDiv()",10)
   }
   catch(e){alert(e.description)}
  }

  function resizeDiv()
  {
   i+=1
   if(i>1288) closeDiv()
   try{
   divHeight = parseInt(document.getElementById("Notation").offsetHeight,10)
   divWidth = parseInt(document.getElementById("Notation").offsetWidth,10)
   docWidth = document.body.clientWidth;
   docHeight = document.body.clientHeight;
   document.getElementById("Notation").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
   document.getElementById("Notation").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
   }
   catch(e){}
  }

  function moveDiv()
  {
   try
   {
   if(parseInt(document.getElementById("Notation").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
   {
   window.clearInterval(objTimer)
   objTimer = window.setInterval("resizeDiv()",1)
   }
   divTop = parseInt(document.getElementById("Notation").style.top,10)
   document.getElementById("Notation").style.top = divTop - 1
   }
   catch(e){}
  }
  function closeDiv()
  {
   document.getElementById('Notation').style.visibility='hidden';
   if(objTimer) window.clearInterval(objTimer)
  }
  
  
         //window.attachEvent('onload',getMsg);
     //window.attachEvent('onresize',resizeDiv);
     getMsg();
     window.οnresize=resizeDiv;
        //alert(window.onload);

function SendNotationData()
{
  try
  {
     var url="/ZhenQing/Notation.aspx";
     var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
     xmlhttp.open('post',url,false);
     xmlhttp.send();
  
     if(xmlhttp.readyState==4)
     {
        if(xmlhttp.status==200)
         {
           //alert(xmlhttp.responseText);
           switch(xmlhttp.responseText)
           {
             case "True":
               return true;
             case "False":
               return false;
             case "":
               return false;
           }
         }
     }
   }
   catch(e)
   {
     alert(e.description);return false;
   }
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值