jquery 消息框


(function(jQuery){
messager:{
size:{width:250,height:150},
title:"信息提示",
time:4000,
timer:null,
timerTitle:null,
docTitle:"",
init:function(title,text){
if($("#message").is("div"))return;
var date =new Date();
var obj=$('<div id="message" class="layer" style="z-index:10000;width:'+this.size.width+'px;height:'+this.size.height+'px;position:absolute;display:none;overflow:hidden;right:0"><iframe src="javascript:false" style="position:absolute;visibility:inherit;top:20px;left:20px;width:1000px;height:1000px;z-index:-1;filter=\'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)\'"></iframe><div class="layerT"><div class="layerTLeft"><div class="layerTMid"><h2>'+title+'</h2><p class="closeP"><input type="button" class="close" /></p></div></div></div><div class="cBox" style="height:'+(this.size.height-30)+'px\"><div>系统消息['+date.toLocaleTimeString()+']</div></br><a href="/Manage/MsgInfo/MsgManage.aspx">'+text+'</a></div></div>');
$(document.body).prepend(obj);
obj.hover(
function(){clearTimeout(this.timer);this.timer=null;},
function(){if(this.time>0)timer=setTimeout($.messager.close,this.time);}
).find("input:first").click(function(){
setTimeout($.messager.close,1);
});
docTitle=document.title;
timerTitle=setInterval(function(){
if(document.title==docTitle)
document.title="【新消息】                        ";
else
document.title=docTitle;
},1000);
$(document).click(function(){
clearInterval(timerTitle);
document.title=docTitle;
});
$(window).focus().scroll(function(){
obj.css("bottom",-document.documentElement.scrollTop);
});
return obj;
},
show:function(title,text,time){
if($("#message").is("div"))return;
document.Title ="dfdf";
if(title=="")title=this.title;
this.init(title,text)
.css("bottom",-document.documentElement.scrollTop).slideDown(800);
if(time>=0)this.time=time;
if(this.time>0)timer=setTimeout(this.close,this.time);
},
setSize:function(width,height){
if($("#message").is("div"))return;
if(width!=0&&width)this.size.width=width;
if(height!=0&&height)this.size.height=height;
},
reset:function(){
this.size={width:250,height:150};
this.title='信息提示';
this.time=4000;
},
close:function(){
$("#message").fadeOut(600);
setTimeout('$("#message").remove()',600);
$.messager.reset();
}
}
} 优质内容筛选与推荐>>
1、MVC与ASP.NET MVC框架概述
2、转:ORA-15186: ASMLIB error function = [asm_open], error = [1], 2009-05-24 13:57:38
3、VS2010功能——任务列表
4、系统状态查看工具Sysstat
5、更改pushViewController和popViewController的动画效果


长按二维码向我转账

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

    阅读
    好看
    已推荐到看一看
    你的朋友可以在“发现”-“看一看”看到你认为好看的文章。
    已取消,“好看”想法已同步删除
    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号