shijiebao 2010-11-12 11:17
浏览 230
已采纳

extjs像msn温馨提示窗口的问题

下面这段extjs代码是一个像msn的提示窗口一样,但是怎么让它从下往上的渐出,而且渐出完以后停留数秒钟自动消失?
[code="javascript"]
var window = new Ext.Window({
// contentEl : Ext.getBody(),
width : 390,
height : 300,
html : "试试试试...",
title : "温馨提示:"
});
window.show();
window.getEl().alignTo(Ext.getBody(), 'br-br');
// 元素从视图中滑出
window.getEl().slideOut('b', {
easing: 'easeOut',
duration : 20
});
[/code]

  • 写回答

3条回答 默认 最新

  • lizhiyezi 2010-11-12 15:55
    关注

    [code="java"]var window = new Ext.Window({
    // contentEl : Ext.getBody(),
    width : 390,
    height : 200,
    shadow : false,
    html : "试试试试...",
    title : "温馨提示:"
    });
    function show() {
    this.el.alignTo(Ext.getBody(), 'br-br');
    this.el.slideIn('b', {
    easing : 'easeOut',
    callback : function() {
    this.close.defer(3000, this); //定时关闭窗口
    },
    scope : this,
    duration : 1
    });

            }
            function hide() {
                if (this.isClose === true) { //防止点击关闭和定时关闭处理
                    return false;
                }
                this.isClose = true;
                this.el.slideOut('b', {
                            easing : 'easeOut',
                            callback : function() {
                                this.un('beforeclose', hide, this);
                                this.close();
                            },
                            scope : this,
                            duration : 5
                        });
                return false;
            }
            window.on('show', show, window);
            window.on('beforeclose', hide, window)
            window.show();[/code]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 Error in check.length("fill") : 'gpar'成分'fill'的长度不能为零
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
  • ¥15 写论文,需要数据支撑
  • ¥15 identifier of an instance of 类 was altered from xx to xx错误
  • ¥100 反编译微信小游戏求指导