仿msn,右下角信息提示页

  1
< script language = " JavaScript "  type = " text/javascript " >
function  Queue() {
    
var items = new Array();
    
var first = 0;
    
var count = 0;
    
this.Count = function(){return count;} ;
    
this.Peek = function(last){
        
var result = null;
        
if (count > 0){
            
if (null != last && true == last)
                result 
= items[first + (count - 1)];
            
else
                result 
= items[first];
        }

        
return result;
    }
;
    
this.Enqueue = function(x){
        items[first 
+ count] = x;
        count
++;
        
return x;
    }
;
    
this.Dequeue = function(){
        
var result = null;
        
if (count > 0){
            result 
= items[first];
            
delete items[first];
            first
++;
            count
--;
        }

        
return result;
    }
;
}


function  Popup_Close() {
    
if (this.popup != null)
        
this.popup.document.onmouseover = null;
    
else
        
this.win.Win.onmouseover = null;
    
this.isMouseOver = false;
    
this.ShowTime = function(){return 3;}
    
this.Hide();
}


function  Popup_Hide() {
    
if (this.popup != null && this.popup.isOpen){
        
this.popup.hide();
    }

    
this.popup = null;
}


function  Popup_ShowTime() {
    
var result = null;
    
if (this.showTime != null)    {
        
var now = new Date();
        result 
= (now - this.showTime)/1000;
    }

    
return result;
}


function  OnClick_Popup(id) {
    alert(id);
}



function  Popup_CreateBody(winID,title,message) {
bodyhtml 
= "<table id="+ winID +" style="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; LEFT: 0px; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: 180px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: 102px; BACKGROUND-COLOR: #1c5b94">"+" "+"<tr>"+" "+"<td>"+" "+"<table cellSpacing=0 cellPadding=0 width="100%" bgColor=#1c5b94 border=0>"+" "+"<tbody>"+" "+"<tr>"+" "+"<td style="FONT-SIZE: 12px; COLOR: #FFFFFF;"> " + title + "</td>"+" "+"</tr>"+" "+"<tr bgcolor="#d7e7f2" onMouseOver="this.style.backgroundColor='#f0f0f0'" onMouseOut="this.style.backgroundColor='#d7e7f2'">"+" "+"<td width="100%" align=left  height=76>"+" "+"<DIV style="BORDER-RIGHT: #9c9e9c 1px solid; PADDING-RIGHT: 13px; BORDER-TOP: #9c9e9c 1px solid; PADDING-LEFT: 13px; FONT-SIZE: 12px; PADDING-BOTTOM: 13px; BORDER-LEFT: #9c9e9c 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 15px; BORDER-BOTTOM: #9c9e9c 1px solid; HEIGHT: 100%">"+" "+ message +" "+ "</td>"+" "+"</tr>"+" "+"</tbody>"+" "+"</table>"+" "+"</td>"+" "+"</tr>"+" "+"</table>"
return bodyhtml;
}


function  Popup_Show()
{
    
this.showTime = new Date();
    
this.popup = window.createPopup();
    
var d = this.popup.document;
    
var b = d.body;
    b.rightmargin 
= 0;
    b.leftmargin 
= 0;
    b.topmargin 
= 0;
    b.bottommargin 
= 0;
    b.innerHTML 
= this.aspxl;

    
var toastWidth = 180;
    
var toastHeight = 102;
    
var toastVerticalMargin = 28;
    
var toastHorizontalMargin = 16;
    
var screenWidth = window.screen.width;
    
var screenHeight = window.screen.height;
    
this.popup.show(screenWidth - toastWidth - toastHorizontalMargin, screenHeight - toastHeight - toastVerticalMargin,toastWidth,toastHeight);
}



function  Popup(winID, message, title) {
    
this.PostID;
    
this.CreateBody = Popup_CreateBody;
    
this.Close = Popup_Close;
    
this.Hide = Popup_Hide;
    
this.Show = Popup_Show;
    
this.ShowTime = Popup_ShowTime;
    
this.aspxl = this.CreateBody(winID, message, title);
}


function  PopupManager() {
    
var queue = new Queue();
    
var canShow = (window.createPopup != null);
    
this.Disabled = false;
    
this.Heartbeat = function(){
        
if (queue.Count() > 0){
            
var p = queue.Peek();
            
var delta = p.ShowTime();
            
if (delta == null){
                
if (!this.Disabled)
                p.Show();
            }

            
else if ((p.popup == null|| (!p.popup.isOpen) || (!p.isMouseOver && delta >= 3)){
                p.Hide();
                queue.Dequeue();
            }

        }

    }

    
this.AddPopup = function(winID, message,title){
        
var result = null;
        
do{
            
if (canShow){
                result 
= new Popup(winID, message,title);
                result.PopupManager 
= this;
                queue.Enqueue(result);
                
this.Heartbeat();
            }

        }

        
while (false);
        
return result;
    }

}




var  popupManager  =   new  PopupManager();
window.setInterval(
" popupManager.Heartbeat(); " 1500 );    
var  p  =  popupManager.AddPopup( " aa " " 111 " " 11111111111 " );
p.PostID 
=   1 ;
=  popupManager.AddPopup( " bb " " 2222 " " 222222222 " );
p.PostID 
=   3 ;
=  popupManager.AddPopup( " popupWin " " 3333 " , " 33333333333 " );
p.PostID 
=   6 ;

</ script >
2
< SCRIPT >  
var  oPopup  =  window.createPopup(); 
var  popTop = 50 ;
function  popmsg(titlestr, msgstr)
var winstr =  "<table id=eMeng style="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; LEFT: 0px; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: 180px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: 102px; BACKGROUND-COLOR: #1c5b94">"+" "+"<tr>"+" "+"<td>"+" "+"<table cellSpacing=0 cellPadding=0 width="100%" bgColor=#1c5b94 border=0>"+" "+"<tbody>"+" "+"<tr>"+" "+"<td style="FONT-SIZE: 12px; COLOR: #FFFFFF;"> " + titlestr + "</td>"+" "+"<td align="right" valign="top"><img id="imgClose" src="Images/closePNormal.gif" width="16" height="16" border="0" onClick="parent.oPopup.hide()" alt="关闭"></td>"+" "+"</tr>"+" "+"<tr bgcolor="#d7e7f2" onMouseOver="this.style.backgroundColor='#f0f0f0'" onMouseOut="this.style.backgroundColor='#d7e7f2'">"+" "+"<td width="100%" align=left colSpan=2 height=76>"+" "+"<DIV style="BORDER-RIGHT: #9c9e9c 1px solid; PADDING-RIGHT: 13px; BORDER-TOP: #9c9e9c 1px solid; PADDING-LEFT: 13px; FONT-SIZE: 12px; PADDING-BOTTOM: 13px; BORDER-LEFT: #9c9e9c 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 15px; BORDER-BOTTOM: #9c9e9c 1px solid; HEIGHT: 100%">"+" "+"注意查阅"+" "+  +" "+"</td>"+" "+"</tr>"+" "+"</tbody>"+" "+"</table>"+" "+"</td>"+" "+"</tr>"+" "+"</table>";
  oPopup.document.body.innerHTML 
= winstr; 
  popshow(); 
}
 
function  popshow()
    
if(popTop>1620){
        clearTimeout(mytime); 
        oPopup.hide();
        
return;
    }
else if(popTop<103){oPopup.show(screen.width-180,screen.height,180,popTop); 
    }
else if(popTop<132){oPopup.show(screen.width-180,screen.height-popTop,180,102);
    }
 
    popTop
+=10
    
var mytime=setTimeout("popshow();",60);
}


popmsg(
" 消息提示 " " <center></center> " ); 
</ script >
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值