用createPopup不过是IE only
代码参考http://www.iamwinter.com/article.asp?id=53

解决方案 »

  1.   

    贴段自己的代码/*  系统桌面提示类 */
    popup = function( msg ){this.create();this.setContent(msg);};
    popup.prototype = {
    create: function(){
    this.win = window.createPopup();
    this.doc= this.win.document;
    this.doc.defaultCharset= "utf-8";
    this.maxHeight = 48;
    this.hideDelay = 8000; //5秒后关闭
    },
    setContent:  function( msg ){
        var html = '<div style="background:#ffffcc;border:1px solid black;padding:4px;font-family:verdana; font-size:70%; width:300px;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,    StartColorStr=\'#0099FF\', EndColorStr=\'#00FFFF\');">\
    <h5 style="margin:4px;font-size:12px;padding:0">系统提示</h5>\
    <div style="margin:4px;">' + msg + '</div></div>';
    this.doc.body.innerHTML = html;
    },
    setPosition: function(){
    this.width = 300;
    this.height = 0;
    this.left = screen.availWidth - this.width - 20;
    this.top = screen.availHeight - this.height;
    },
    show: function(){
    this.setPosition();
    this.moveup();
    var self =this;
    setTimeout(function(){self.movedown()}, this.hideDelay );
    },
    hide: function(){ 
    this.movedown();
    },
    moveup: function(){
    if( this.height >= this.maxHeight )
    clearTimeout( this.timer );
    else
    {
    this.height += 2;
    this.top = screen.availHeight - this.height;
    this.win.show(this.left,this.top,this.width,this.height);
    var self = this;
    var f = function(){self.moveup()};
    this.timer = setTimeout( f, 10 );
    }
    },
    movedown: function(){
    if( this.height <= 0 )
    clearTimeout( this.timer );
    else
    {
    this.height -= 2;
    this.top = screen.availHeight - this.height;
    this.win.show(this.left,this.top,this.width,this.height);
    var self = this;
    var f = function(){self.movedown()};
    this.timer = setTimeout( f, 10 );
    }
    }}用法
    var msg = '有新的会员加入';
    MSPOP = new popup( msg );
    MSPOP.show();