ExtJs 实现类似QQ的提示消息框
2014-02-20 16:03
344 查看
ExtJs实现类似QQ的提示消息框
1 扩展Ext.Window控件
2 调用方法
1 扩展Ext.Window控件
Ext.namespace("Ext.ux"); Ext.ux.SysMsgWindowManager = { positions: [] }; Ext.ux.SysMsgWindow = Ext.extend(Ext.Window, { setTitle: function(title, iconCls){ Ext.ux.SysMsgWindow.superclass.setTitle.call(this, title, iconCls||this.iconCls); }, setMessage: function(msg){ this.body.update(msg); }, initComponent: function(){ Ext.apply(this, { iconCls: this.iconCls || 'information', width: 250, height: 150, autoScroll: true, autoDestroy: true, plain: false, shadow:false }); this.task = new Ext.util.DelayedTask(this.hide, this); Ext.ux.SysMsgWindow.superclass.initComponent.call(this); }, onRender:function(ct, position) { Ext.ux.SysMsgWindow.superclass.onRender.call(this, ct, position); }, onDestroy: function(){ Ext.ux.SysMsgWindowManager.positions.remove(this.pos); Ext.ux.SysMsgWindow.superclass.onDestroy.call(this); }, afterShow: function(){ Ext.ux.SysMsgWindow.superclass.afterShow.call(this); this.on('move', function(){ Ext.ux.SysMsgWindowManager.positions.remove(this.pos); this.task.cancel(); }, this); this.task.delay(4000); }, animShow: function(){ this.pos = 0; while(Ext.ux.SysMsgWindowManager.positions.indexOf(this.pos)>-1) this.pos++; Ext.ux.SysMsgWindowManager.positions.push(this.pos); this.setSize(250,150); this.el.alignTo(document, "br-br", [ -10, -10-((this.getSize().height+10)*this.pos) ]); this.el.slideIn('b', { duration: 2, callback: this.afterShow, scope: this }); }, animHide: function(){ Ext.ux.SysMsgWindowManager.positions.remove(this.pos); this.el.ghost("b", { duration: 2, remove: true, scope: this, callback: this.destroy }); } }); |
<script type="text/javascript"> Ext.onReady(function(){ Ext.get('alert').on('click',function(){ new Ext.ux.SysMsgWindow({ title: '提示窗口', html: '测试信息', iconCls: 'error' }).show(document); }); }); </script> |
相关文章推荐
- WinForm:实现类似QQ消息框一样的右下角消息提示窗口
- winforms实现类似QQ消息框一样的右下角消息提示窗口
- winforms实现类似QQ消息框一样的右下角消息提示窗口
- winforms实现类似QQ消息框一样的右下角消息提示窗口
- JavaScript实现类似QQ、MSN消息提示的效果(转载)
- Android锁屏通知(activity实现)类似新版qq的锁屏消息提示
- ExtJs实现类似QQ的右下角消息弹出框 (2013-04-01 19:04:43)转载▼
- winforms实现类似QQ消息框一样的右下角消息提示窗口
- ASP.NET中实现类似MSN消息提示功能
- 页面右下角弹出类似QQ或MSN的消息提示
- 页面右下角弹出类似QQ或MSN的消息提示
- javascript实现防MSN、QQ的消息提示样式
- 类似QQ拖动气泡删除消息的气泡实现
- 利用ImageView + fragment 实现类似QQ消息界面的 点击不同按钮 展示不同界面
- MFC实现类似QQ消息弹出框置顶但不抢用户输入焦点
- QQ风格淡入淡出消息提示窗口的实现(WinForm)
- 仿QQ、MSN消息提示窗口的实现(C#)
- 用JavaScript实现类似QQ好友上线的提示窗体
- Winform托盘NotifyIcon使用(类似QQ消息提示)
- 利用DecorView实现播放视频开灯/关灯效果和仿QQ消息提示框