222222222
来源:互联网 发布:arttemplate 写js语法 编辑:程序博客网 时间:2024/06/04 22:46
var docEle = function () {
return document.getElementById(arguments[0]) || false;
}
var _heights,__heights;
var layer = (function () {
return {
Mask: function () {
if (docEle("fullbg")) {
document.body.removeChild(docEle("fullbg"));
}
var fullbg = document.createElement("div");
fullbg.setAttribute("id", "fullbg");
fullbg.style.display = "block";
var _scrollWidth = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);
var _scrollHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
fullbg.style.width = _scrollWidth + "px";
fullbg.style.height = _scrollHeight + "px";
document.body.appendChild(fullbg);
this.Loading();
},
Iframe: function () {
if (docEle("fullbg")) {
document.body.removeChild(docEle("fullbg"));
}
var fullbg = document.createElement("div");
fullbg.setAttribute("id", "fullbg");
fullbg.style.display = "block";
var _scrollWidth = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);
var _scrollHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
fullbg.style.width = _scrollWidth + "px";
fullbg.style.height = _scrollHeight + "px";
document.body.appendChild(fullbg);
if (docEle("popdiv")) {
document.body.removeChild(docEle("popdiv"));
}
var popdiv = document.createElement("div");
popdiv.setAttribute("id", "popdiv");
popdiv.style.width = arguments[1] + "px";
popdiv.style.height = arguments[2] + "px";
popdiv.innerHTML = arguments[0];
document.body.appendChild(popdiv);
this.setcenter("popdiv");
},
Loading: function () {
if (docEle("Loading")) {
document.body.removeChild(docEle("Loading"));
}
var popdiv = document.createElement("div");
popdiv.setAttribute("id", "Loading");
popdiv.style.top = (document.documentElement.scrollTop + document.documentElement.clientHeight / 2 - 15) + "px";
popdiv.style.left = (document.body.scrollLeft + document.body.clientWidth / 2 - 100) + "px";
if (g == "0") {
popdiv.innerHTML = "页面加载中...";
}
else if (g == "1") {
popdiv.innerHTML = "頁面加載中...";
}
else if (g == "2") {
popdiv.innerHTML = "loading...";
}
document.body.appendChild(popdiv);
},
setcenter: function (objectId) {
var bH = $(window).height();
var bW = $(window).width();
this._left = bW / 2 - (parseInt($("#" + objectId).width()) / 2);
this._top = bH / 2 - (parseInt($("#" + objectId).height()) / 2);
$("#" + objectId).css("left", this._left)
.css("top", this._top)
.css("position", "absolute");
},
Closelayer: function () {
document.body.removeChild(docEle("fullbg"));
document.body.removeChild(docEle("Loading"));
},
CloseIfram: function () {
document.body.removeChild(docEle("fullbg"));
document.body.removeChild(docEle("popdiv"));
}
}
})();
return document.getElementById(arguments[0]) || false;
}
var _heights,__heights;
var layer = (function () {
return {
Mask: function () {
if (docEle("fullbg")) {
document.body.removeChild(docEle("fullbg"));
}
var fullbg = document.createElement("div");
fullbg.setAttribute("id", "fullbg");
fullbg.style.display = "block";
var _scrollWidth = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);
var _scrollHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
fullbg.style.width = _scrollWidth + "px";
fullbg.style.height = _scrollHeight + "px";
document.body.appendChild(fullbg);
this.Loading();
},
Iframe: function () {
if (docEle("fullbg")) {
document.body.removeChild(docEle("fullbg"));
}
var fullbg = document.createElement("div");
fullbg.setAttribute("id", "fullbg");
fullbg.style.display = "block";
var _scrollWidth = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth);
var _scrollHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
fullbg.style.width = _scrollWidth + "px";
fullbg.style.height = _scrollHeight + "px";
document.body.appendChild(fullbg);
if (docEle("popdiv")) {
document.body.removeChild(docEle("popdiv"));
}
var popdiv = document.createElement("div");
popdiv.setAttribute("id", "popdiv");
popdiv.style.width = arguments[1] + "px";
popdiv.style.height = arguments[2] + "px";
popdiv.innerHTML = arguments[0];
document.body.appendChild(popdiv);
this.setcenter("popdiv");
},
Loading: function () {
if (docEle("Loading")) {
document.body.removeChild(docEle("Loading"));
}
var popdiv = document.createElement("div");
popdiv.setAttribute("id", "Loading");
popdiv.style.top = (document.documentElement.scrollTop + document.documentElement.clientHeight / 2 - 15) + "px";
popdiv.style.left = (document.body.scrollLeft + document.body.clientWidth / 2 - 100) + "px";
if (g == "0") {
popdiv.innerHTML = "页面加载中...";
}
else if (g == "1") {
popdiv.innerHTML = "頁面加載中...";
}
else if (g == "2") {
popdiv.innerHTML = "loading...";
}
document.body.appendChild(popdiv);
},
setcenter: function (objectId) {
var bH = $(window).height();
var bW = $(window).width();
this._left = bW / 2 - (parseInt($("#" + objectId).width()) / 2);
this._top = bH / 2 - (parseInt($("#" + objectId).height()) / 2);
$("#" + objectId).css("left", this._left)
.css("top", this._top)
.css("position", "absolute");
},
Closelayer: function () {
document.body.removeChild(docEle("fullbg"));
document.body.removeChild(docEle("Loading"));
},
CloseIfram: function () {
document.body.removeChild(docEle("fullbg"));
document.body.removeChild(docEle("popdiv"));
}
}
})();
0 0
- 222222222
- 222222222
- 222222222
- 222222222
- 222222222
- 222222222
- 111111111
- Linux中常用操作命令
- 手把手教你:styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches th
- 表达式求值算法
- 【Android消息处理机制】android的消息处理机制(图+源码分析)——Looper,Handler,Message
- 222222222
- 搭建Hadoop伪分布式环境,及运行wordcount程序总结
- JAVA代理模式与动态代理模式
- linux 查看端口号暂用
- 【Android消息处理机制】正确理解ThreadLocal(一)
- Android中PopupWindow的用法
- 3333333
- Android面试题二
- bzoj2005: [Noi2010]能量采集 莫比乌斯反演