从下向上弹出窗口(像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" onclick="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.onresize=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;
   }
}

阅读更多
个人分类: JavaScript .NET
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

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

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭