随笔 - 341,  文章 - 4,  评论 - 37,  阅读 - 16万

/*    消息构造 
*/ 
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)     
    

  

posted on   WPF之家  阅读(500)  评论(0编辑  收藏  举报
编辑推荐:
· dotnet 源代码生成器分析器入门
· ASP.NET Core 模型验证消息的本地化新姿势
· 对象命名为何需要避免'-er'和'-or'后缀
· SQL Server如何跟踪自动统计信息更新?
· AI与.NET技术实操系列:使用Catalyst进行自然语言处理
阅读排行:
· dotnet 源代码生成器分析器入门
· 官方的 MCP C# SDK:csharp-sdk
· 一款 .NET 开源、功能强大的远程连接管理工具,支持 RDP、VNC、SSH 等多种主流协议!
· 一步一步教你部署ktransformers,大内存单显卡用上Deepseek-R1
· 一次Java后端服务间歇性响应慢的问题排查记录
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示