Ext.Window滑入滑出效果

2 篇文章 0 订阅
项目有个模块,进去模块后,页面右下角会滑出一个向上的窗体,窗体内容区提示一些内容。

顿生好奇之心,赶紧去看看源码,,尼玛自己封装的!经过几次修改,想加入自己的元素,但愣是不生效。而且滑出的窗口,拖动后还BUG不断~~~

自己写个简易的好了,供以后设计时用到:

function getMsgWindow(errorInfo){
msgWindow = msgWindow || new Ext.Window({
title : '提示窗口',
width : 210,
height : 100,
autoScroll : true,
autoDestroy : true,
closable : false,
plain : false,
shadow : false,
draggable : false ,
html :errorInfo, iconCls : 'error'
});
//show时窗口自下而上滑动
msgWindow.on('show',function(){
msgWindow.setPosition(document.documentElement.scrollWidth , document.documentElement.scrollHeight);
msgWindow.el.alignTo(document, "br-br",
[ -0,-20 - ((msgWindow.getSize().height + 10) * 0.1) ]);
msgWindow.el.slideIn('b', {
duration : 1,
callback : null,
scope : this
});
});
msgWindow.show();
}

function optionWindow(tipsInfo){
try{
if(msgWindow == null){
getMsgWindow(tipsInfo);
}else{
msgWindow.show();
}
(new Ext.util.DelayedTask(function(){
msgWindow.hide();
},this)).delay(3000);
}catch(e){
getMsgWindow(tipsInfo); }
}



用法:
调用optionWindow。其中tipsInfo表示窗体内要展示的信息。

注:都是EXT的东东,在msgWindow.on('show'这个监听里,你可以完成自己的事。

扩展:可以做一些改变,使窗体的滑出位置可控。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值