jquery实现索屏

Messages = {

//简单显示消息
showMsg : function(msg){
this.popupMessages(0,msg);
},

//简单显示消息并带确定按钮
okMsg : function(msg){
this.popupMessages(1,msg);
},
//简单显示消息并带确任,取消按钮(未实现)
confirmMsg : function(msg){
this.popupMessages(2,msg);
},

/********************************************锁屏***************************************************/
//打开
openLoadingDiv : function(){
var strDiv="<div id='loadImgDiv' style='background-color: #ffffe1;z-Index:10001;border:1px solid;border-color: silver;width:140px;position: absolute;left:"+(document.body.clientWidth-120)/2+";top:"+(document.body.clientHeight-25)/2+"'>"+
"<table align='center'>"+
"<tr>"+
"<td>"+
"<img style='height:22px;width:22px' src='"+Utils.getRootPath()+"/root/images/loading4.gif'/>"+
"</td>"+
"<td style='font-size: 15px;'>"+
"数据处理中..."+
"</td>"+
"</tr>"+
"</table>"+
"</div>";
$("select").attr("disabled","disabled");
this.openShadeDiv();
$("body").append(strDiv);
},

//遮罩层
openShadeDiv : function(){
var wnd = $(window);
var doc = $(document);
var wHeight=0;
var wWidth=0;
//当高度少于一屏
if(wnd.height()>doc.height()){
wHeight = wnd.height();
wWidth = wnd.width();
}else{
//当高度大于一屏
wHeight = doc.height();
wWidth = doc.width();
}
//创建遮罩背景
$("body").append("<div id=shadeDiv></div>");
$("body").find("#shadeDiv")
.width(wWidth)
.height(wHeight)
.css({
position:"absolute",
top:"0px",left:"0px",
background:"#ccc",
filter:"Alpha(opacity=50);",
opacity:"0.3",zIndex:"10000"
});
},

//关闭
closeLoadingDiv : function(){
$("select").attr("disabled","");
$("#shadeDiv").remove();
$("#loadImgDiv").remove();
},

/**************************************操作完成后加载显示提示信息*******************************************/
/**
* 执行操作操作后相应操作结果
*/
popupMessages : function(tepy, msg){

//定义操作提示层.
//background='"+Utils.getRootPath()+"/root/images/messages.gif'
//<div id='messagesLayer' style='border:1px solid red; width:200px ; position:absolute ;100px; right: 50%; top: 0px;' >
var popUpDiv="<div id='messagesLayer' style='width:244px; heigth:auto; position:absolute ;100px; right: 50%; top: 0px; display:none; z-Index:11000;'>"+
"<table width='244' height='172' id='messagesTable' cellpadding='0' cellspacing='0' background='"+Utils.getRootPath()+"/root/images/msg_bg.gif' style='background-repeat:repeat;' >"+
"<tr>"+
"<td width='189' height='26'></td>"+
"</tr>"+
"<tr>"+
"<td align='center' valign='middle'>"+
"<div style='width:220px;><font style='font-size: 12px;'>"+(msg)+"<br><br></font><div>"+
"</td>"+
"</tr>"+
"</table>"+
"</div>";

$("#messagesLayer").remove();
if(tepy == 0){
$("body").append(popUpDiv);
$("#messagesLayer").slideDown(1000);
//延迟2秒钟后隐藏提示层.
setTimeout(function (){
$("#messagesLayer").slideUp();
}, 3000);
}
if(tepy == 1){
$("body").append(popUpDiv);
$("#messagesLayer").slideDown(1000);
$("#messagesTable").append("<tr><td align='right'><span style='algin:right;'>确定</span></td></tr>");
}
if(tepy == 2){
this.openLoadingDiv();
$("body").append(popUpDiv);
$("#messagesLayer").slideDown(1000);
$("#messagesTable").append("<tr><td align='right'><a href='#'>确定</a>   <a href='#' οnclick='javascript:Message.closeLoadingDiv();$(\"#messagesLayer\").slideUp();'>取消</a>   </td></tr>");
}
}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值