页面右下角弹出类似QQ或MSN的消息提示

<HTML><HEAD>
<TITLE>网页特效观止|CHINAHTML|---页面右下角弹出类似QQ或MSN的消息提示</TITLE>
<SCRIPT language=JavaScript> 
<!-- 
 
/**//* 
**    ============================================================ 
**    类名:CLASS_MSN_MESSAGE 
**    功能:提供类似MSN消息框 
**    示例: 
    --------------------------------------------------------------------------------------
  
            var MSG = new CLASS_MSN_MESSAGE("aa",200,120,"短消息提示:","您有1封消息","今天请我吃饭哈"); 
                MSG.show(); 
 
    -------------------------------------------------------------------------------------


**    作者:ttyp 
**    邮件:ttyp@21cn.com 
**   
**    ============================================================
**/ 
 
 
/**//* 
*    消息构造 
*/ 
function CLASS_MSN_MESSAGE(id,width,height,caption,title,message,target,action){ 
    this.id     = id; 
    this.title  = title; 
    this.caption= caption; 
    this.message= message; 
    this.target = target; 
    this.action = action; 
    this.width    = width?width:200; 
    this.height = height?height:120; 
    this.timeout= 150; 
    this.speed    = 20;
    this.step    = 1;
    this.right    = screen.width -1; 
    this.bottom = screen.height;
    this.left    = this.right - this.width;
    this.top    = this.bottom - this.height;
    this.timer    = 0;
    this.pause    = false;
    this.close    = false;
    this.autoHide    = true;

 
/**//* 
*    隐藏消息方法 
*/ 
CLASS_MSN_MESSAGE.prototype.hide = function(){ 
    if(this.onunload()){  数据挖掘交友

        var offset  = this.height>this.bottom-this.top?this.height:this.bottom-this.top;
        var me  = this;  数据挖掘论坛

        if(this.timer>0){  
            window.clearInterval(me.timer); 
        } 

数据挖掘论坛

        var fun = function(){ 
            if(me.pause==false||me.close){
                var x  = me.left;
                var y  = 0;
                var width = me.width;
                var height = 0;
                if(me.offset>0){
                    height = me.offset;
                }
     数据挖掘研究院
                y  = me.bottom - height;
    
                if(y>=me.bottom){
                    window.clearInterval(me.timer); 
                    me.Pop.hide(); 
                } else {
                    me.offset = me.offset - me.step; 
                }
                me.Pop.show(x,y,width,height);    数据挖掘研究院
            }            
        }  数据挖掘工具

        this.timer = window.setInterval(fun,this.speed)     
    } 

 
/**//* 
*    消息卸载事件,可以重写 
*/ 
CLASS_MSN_MESSAGE.prototype.onunload = function() { 
    return true; 

/**//* 
*    消息命令事件,要实现自己的连接,请重写它 

*/ 
CLASS_MSN_MESSAGE.prototype.oncommand = function(){ 
    //this.close = true;
    this.hide(); 
 window.open("http://www.baidu.com");
  
}
/**//* 
*    消息显示方法 
*/ 
CLASS_MSN_MESSAGE.prototype.show = function(){  数据挖掘研究院

    var oPopup = window.createPopup(); //IE5.5+ 
   
    this.Pop = oPopup; 
 
    var w = this.width; 
    var h = this.height; 
 
    var str = "<DIV style="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: " + w + "px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: " + h + "px; BACKGROUND-COLOR: #c9d3f3">" 
        str += "<TABLE style="BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid" cellSpacing=0 cellPadding=0 width="100%" bgColor=#cfdef4 border=0>" 
        str += "<TR>" 
        str += "<TD style="FONT-SIZE: 12px;COLOR: #0f2c8c" width=30 height=24></TD>"  数据挖掘工具
        str += "<TD style="PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; COLOR: #1f336b; PADDING-TOP: 4px" vAlign=center width="100%">" + this.caption + "</TD>" 
        str += "<TD style="PADDING-RIGHT: 2px; PADDING-TOP: 2px" vAlign=center align=right width=19>" 
        str += "<SPAN title=关闭 style="FONT-WEIGHT: bold; FONT-SIZE: 12px; CURSOR: hand; COLOR: red; MARGIN-RIGHT: 4px" id="btSysClose" >×</SPAN></TD>" 
        str += "</TR>" 
        str += "<TR>" 
        str += "<TD style="PADDING-RIGHT: 1px;PADDING-BOTTOM: 1px" colSpan=3 height=" + (h-28) + ">"  数据挖掘研究院
        str += "<DIV style="BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; PADDING-BOTTOM: 8px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 8px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%">" + this.title + "<BR><BR>" 
        str += "<DIV style="WORD-BREAK: break-all" align=left><A href="javascript:void(0)" hidefocus=false id="btCommand"><FONT color=#ff0000>" + this.message + "</FONT></A>fghfghfghghghgh<A href="http://www.sohu.com" hidefocus=false id="ommand"><FONT color=#ff0000>dfgdfgfg</FONT></A></DIV>" 
        str += "</DIV>" 
        str += "</TD>"  数据挖掘实验室
        str += "</TR>" 
        str += "</TABLE>" 
        str += "</DIV>" 
 
    oPopup.document.body.innerHTML = str;
   
 
    this.offset  = 0;
    var me  = this;  数据挖掘工具

    oPopup.document.body.onmouseover = function(){me.pause=true;}
    oPopup.document.body.onmouseout = function(){me.pause=false;}

数据挖掘交友

    var fun = function(){ 
        var x  = me.left;
        var y  = 0;
        var width    = me.width;
        var height    = me.height; 数据挖掘交友

            if(me.offset>me.height){
                height = me.height;
            } else {
                height = me.offset;
            } 数据挖掘论坛

        y  = me.bottom - me.offset;
        if(y<=me.top){
            me.timeout--;
            if(me.timeout==0){
                window.clearInterval(me.timer); 
                if(me.autoHide){
                    me.hide();
                }
            }
        } else {
            me.offset = me.offset + me.step;

数据挖掘论坛


        }
        me.Pop.show(x,y,width,height);    数据挖掘交友

    } 
 
    this.timer = window.setInterval(fun,this.speed)     
 
    
 
    var btClose = oPopup.document.getElementById("btSysClose"); 
 
    btClose.onclick = function(){ 
        me.close = true;
        me.hide(); 
    } 
 
    var btCommand = oPopup.document.getElementById("btCommand"); 
    btCommand.onclick = function(){ 
        me.oncommand(); 
    }   
  var ommand = oPopup.document.getElementById("ommand"); 
      ommand.onclick = function(){ 
       //this.close = true;

数据挖掘研究院


    me.hide(); 
 window.open(ommand.href);
    }  

/**//*
** 设置速度方法
**/
CLASS_MSN_MESSAGE.prototype.speed = function(s){
    var t = 20;
    try {
        t = praseInt(s);
    } catch(e){}
    this.speed = t;
}
/**//*
** 设置步长方法
**/
CLASS_MSN_MESSAGE.prototype.step = function(s){
    var t = 1;
    try {
        t = praseInt(s);
    } catch(e){}
    this.step = t;
}
 
CLASS_MSN_MESSAGE.prototype.rect = function(left,right,top,bottom){
    try {
        this.left        = left    !=null?left:this.right-this.width;
        this.right        = right    !=null?right:this.left +this.width;
        this.bottom        = bottom!=null?(bottom>screen.height?screen.height:bottom):screen.height;
        this.top        = top    !=null?top:this.bottom - this.height;
    } catch(e){}
}
var MSG1 = new CLASS_MSN_MESSAGE("aa",200,120,"短消息提示:","您有1封消息","今天请我吃饭哈"); 
    MSG1.rect(null,null,null,screen.height-50);
    MSG1.speed    = 10;
    MSG1.step    = 5;
    //alert(MSG1.top);
    MSG1.show();  数据挖掘论坛

//同时两个有闪烁,只能用层代替了,不过层不跨框架
//var MSG2 = new CLASS_MSN_MESSAGE("aa",200,120,"短消息提示:","您有2封消息","好的啊"); 
//   MSG2.rect(100,null,null,screen.height);
//    MSG2.show(); 
//--> 
</SCRIPT>

<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY></BODY></HTML>

[数据挖掘专家] [数据挖掘研究院] [数据挖掘论坛] [数据挖掘实验室]
上一篇:用Dreamweaver进行数据库操作
下一篇:用FrontPage2000作动态网页
最新评论共有 0 位网友发表了评论 , 查看所有评论
发表评论( 不能超过250字,需审核,请自觉遵守互联网相关政策法规。 )
匿名?
数据挖掘网站导航 数据挖掘论坛导航
  • 数据挖掘工具
  • 数据挖掘论坛
  • DataCruncher - Cognos
  • MineSet - MathSoft
  • Intelligent Miner - GainSmarts
  • Sqlserver - SAS - Clementine
  • CART - Weka - WizSoft
  • NeuroShell - ModelQuest
  • data mining tools - Darwin
  • 数据挖掘交友
  • 数据挖掘博客
  • 数据挖掘工具
  • 数据挖掘资源
  • 数据挖掘技术算法
  • 数据挖掘相关期刊、会议
  • 研究院联盟合作专区
  • 数据挖掘基础与相关技术
  • 数据挖掘厂商与就业
  • 数据挖掘研究者乐园
  • 知名厂商数据挖掘工具资料
  • 国内数据挖掘实验室
  • Foreign Data Mining Lab
  • 热点关注
  • 网页javascript精华代码集
  • Javascript高级教程-神奇的字符串处理
  • Javascript高级教程-分割方法(splitting me
  • JS+CSS打造可拖动的聊天窗口层
  • javaScript对象和属性
  • 用FrontPage2003轻松制作ASP动态网页
  • JavaScript高级教程 - 子字符串
  • Javascript高级教程-介绍cookie
  • Javascript高级教程
  • JS无缝滚屏效果
  • 论坛最新话题
  • Foundations of Statistical Natural Langu
  • Game Theory meet Data Mining: A Recent P
  • System Building: How does it help or hin
  • 数据挖掘与Clementine培训
  • 新手报到
  • 求 SASEM 客户流失预测分析
  • 数据挖掘工程师/搜索研究院—北京——无线
  • 数据挖掘入门介绍(如何着手数据挖掘)
  • Information Overload Survey Results
  • The INEX 2005 Workshop on Element Retrie
  • 相关资讯
  • JavaScript高级教程 - 相关数组
  • Javascript高级教程-分割方法(splitting me
  • JavaScript高级教程 - 子字符串
  • Javascript高级教程-神奇的字符串处理
  • JavaScript高级教程 - 变量的使用方法
  • JavaScript高级教程 - 什么是变量
  • 一个if-then-else的快捷方式
  • Javascript高级教程-本教程的课程计划
  • Javascript高级教程
  • Javascript高级教程-介绍cookie
  • 数据挖掘实验室资料
  • 数据挖掘博客地址
  • 数据挖掘实验室网站地址
  • Prepare for Medicare audits by using dat
  • 注册成为SAS用户与爱好者俱乐部会员
  • 水南梅
  • 明日烟
  • 新人报道
  • 下载
  • 厦门服务器托管,450元/月—0592-5177319 高
  • 买空间送域名--0592-5177319 高静