男孩女孩好听名字大全:Ext消息提示框,显示几秒后自动消失
来源:百度文库 编辑:偶看新闻 时间:2024/05/06 02:11:52
封装一个Ext消息提示框,显示几秒后自动消失
分类: Ext 2009-12-23 22:11 2842人阅读 评论(4) 收藏 举报最近项目需要,封装了一个Ext消息提示框,提示信息显示几秒后就自动消失。
css代码:
view plaincopy to clipboardprint?
- .msg .x-box-mc {
- font-size:14px;
- }
- #msg-div {
- position:absolute;
- left:650px;
- top:410px;
- width:600px;
- z-index:20000;
- }
- .msg-close{
- width:10px; height:10px; position:absolute; top:1px; right:10px;cursor:hand;
- }
- .msg-h3 {
- font-size:13px;
- color:#2870b2;
- font-weight:bold;
- margin:10px 0;
- }
js代码:
view plaincopy to clipboardprint?
- /**
- *信息提示框,显示后迅速消失
- */
- Ext.QuickMsg = function(){
- var msgCt;
- function createBox(t, s,isClose){
- var html = new Array();
- html.push('');');
- html.push('
');');- html.push('
- html.push('
');');- if(t){
- html.push('
');
- html.push(t);
- html.push('');
- }
- if(isClose){
- html.push('');
- }
- html.push(s);
- html.push('
- html.push('
');- html.push('
- html.push('
- return html.join('');
- }
- return {
- /**
- * 显示信息
- * title:标题
- * msg:提示信息
- * time:显示时间,超时后自动消失
- * alignEl:对齐到该对象的左下角
- * offsets[Array]:横向偏移像素,比如:[200,0]标识右移200个像素
- * positon:动画
- * animate[boolean]:是否开启动画
- * isClose[boolean]:是否可关闭
- */
- show : function(title, msg, width, time, alignEl, offsets, position,animate,isClose){
- width = width?width:'250px';
- time = time?time:2;
- alignEl = alignEl?alignEl:document;
- //alert(alignEl.id);
- position = position?position:'t-t';
- animate = animate?animate:false;
- this.close();
- if(!msgCt){
- msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div'}, true);
- msgCt.setWidth(width);
- }
- //采用默认动画将div的最中央对齐到alignEl的左下角,并右移200个象素,且不能超出窗口
- msgCt.alignTo(alignEl, position,offsets,animate);
- var m = Ext.DomHelper.append(msgCt, {html:createBox(title, msg,isClose)}, true);
- m.slideIn('t').pause(time).ghost("t", {remove:true});//元素从上滑入效果,可不带参数调用下同
- },
- //提示信息
- alert : function(msg,field,alignEl,width){
- width = width?width:'150px';
- var html = ''+msg+'';
- this.show('',html,'150px',2,field,[120,0],'t-t',true,false);
- },
- close: function(){
- var div = document.getElementById('msg-div');
- if(div){
- div.style.display = 'none';
- }
- msgCt = '';
- }
- };
- }();
自动消失的提示框无法消失,刷新没有用
打开电脑,屏幕右下角出现一个像QQ消息提示的框(不是QQ的)不点击不会消失
为什么每次我的MSN登陆后显示图片都自己换,个人消息也自动消失???重装了MSN还是这样.
怎样用vbscript的MsgBox 函数控制弹出提示框对话框中显示消息
哪个代码可以实现,网页中的图片在显示几秒后自动消失
网络经常自动断掉,连接状态的显示框一闪就消失~
网页中的提示消息的显示速度怎么设定?
为什么我的群不能显示提示消息?
vc消息框显示变量
我的QQ在每次打开的时候都会弹出一个提示框,告诉我有一封新邮件,然后再自动消失,
msn7.5,我要发消息,会弹出"需要Flash player"的提示框.收发的消息在上面的对话框没有显示.
谁能发布一个能下沉的背投广告 源代码啊,显示几秒后自动在页面消失的那种!
上网以后,有一个网站自动显示,并且自动消失。怎么办
QQ游戏可以登录,但QQ不能登录,提示储存本地消息密码文件消失,怎么回事啊!!1
QQ弹出的消息,不手动关闭,它为什么能自动消失。想再去查看到哪里找
RUNDLL32。EXT这个文件出问题了怎么办?开机的时候提示的!急!!
RUNDLL32。EXT这个文件出问题了怎么办??开机的时候提示的!急!!
,刚刚提示完插入光盘2,安装程序就自动消失拉
为什么我在浏览网业的时候,浏览器会自动消失没有任何提示!
没有什么提示,在接受消息时,QQ自动关闭的原因
怎么设置QQ不让它自动弹出有人上线的提示消息呀
网络连接提示消失
光驱自动消失为什么?
QQ自动消失拉