js彈出層或者js彈出引用url Frame 層
function Popup() {
var _this = this;
this.CssName = "layermask";//樣式
//遮蓋層
this.hiddLayer = function() {
try{
var obj = document.getElementById("syspopup_layer");
if (obj != null)
document.body.removeChild(obj);
}catch(e){}
}; this.showLayer = function() {
try{
var obj = document.getElementById("syspopup_layer");
if (obj == null) {
obj = document.createElement("DIV");
obj.id = "syspopup_layer";
obj.className = this.CssName;
obj.disabled = true;
document.body.appendChild(obj); var size = qp_shared.getPageSize(); obj.style.cssText = qp_shared.contact("left: 0px; width: ", size.width, "px; top: 0px; height: ", size.height, "px;");
}
}catch(e){}
}; this.showLoading = function() {
if (el("sysimg_wait") == null) {
this.Loading = document.createElement("IMG");
this.Loading.id = "sysdiv_wait";
this.Loading.src = qp_shared.getURL("images/wait/reloading.gif");
this.Loading.style.zIndex = ;
this.Loading.style.position = "absolute";
this.Loading.style.left = parseInt((window.document.documentElement.clientWidth - )/) + "px";
this.Loading.style.top = (parseInt((window.document.documentElement.clientHeight - )/) + qp_shared.getDocumentScrollTop()) + "px"; document.body.appendChild(this.Loading);
}; this.showLayer();
}; this.Render = function(url, w, h) {
if (el("sysimg_wait") == null) {
this.Loading = document.createElement("IMG");
this.Loading.id = "sysdiv_wait";
this.Loading.src = qp_shared.getURL("images/wait/reloading.gif");
this.Loading.style.zIndex = ;
this.Loading.style.position = "absolute";
this.Loading.style.left = parseInt((window.document.documentElement.clientWidth - )/) + "px";
this.Loading.style.top = (parseInt((window.document.documentElement.clientHeight - )/) + qp_shared.getDocumentScrollTop()) + "px"; document.body.appendChild(this.Loading);
}; if (el("sysdiv_loginFrame") == null) {
this.DivFrame = document.createElement("DIV");
this.DivFrame.id = "sysdiv_loginFrame";
this.DivFrame.style.cssText = "z-index: 99999; position: absolute; left: 0px; top: 0px; display: none; width: 880px; height: 300px; background-color: #ffffff; border: solid 7px #ddd;"; this.PageFrame = document.createElement("IFRAME");
this.PageFrame.id = "sysifm_loginFrame";
this.PageFrame.align = "middle";
this.PageFrame.frameBorder = "";
this.PageFrame.scrolling = "auto";
this.PageFrame.style.cssText = "z-index: 101; position: absolute; left: 0px; top: 0px";
this.PageFrame.src = url; this.DivFrame.appendChild(this.PageFrame);
document.body.appendChild(this.DivFrame);
}
else {
this.PageFrame.src = url;
} if (qp_shared.IsIE && this.PageFrame.readyState != "complete")
this.PageFrame.onreadystatechange = function(e) { e = window.event || e; _this.onreadystatechange(e); };
else if(!qp_shared.IsIE)
this.PageFrame.onload = function(e) { e = window.event || e; _this.onreadystatechange(e); };
else
this.removeLoading();
}; this.RenderDiv=function(w,h,html){ if (el("sysimg_wait") == null) {
this.Loading = document.createElement("IMG");
this.Loading.id = "sysdiv_wait";
this.Loading.src = qp_shared.getURL("images/wait/reloading.gif");
this.Loading.style.zIndex = ;
this.Loading.style.position = "absolute";
this.Loading.style.left = parseInt((window.document.documentElement.clientWidth - )/) + "px";
this.Loading.style.top = (parseInt((window.document.documentElement.clientHeight - )/) + qp_shared.getDocumentScrollTop()) + "px"; document.body.appendChild(this.Loading);
}; if (el("sysDiv_Dialog") == null) { this.Div_Dialog = document.createElement("DIV"); //創建div對象
this.Div_Dialog.id = "sysDiv_Dialog";
this.Div_Dialog.style.cssText = "z-index: 99999; position: absolute; left: 0px; top: 0px; display: none; width:"+w+"px; height: "+h+"px; background-color: #ffffff; border: solid 7px #ddd;";
} document.body.appendChild(this.Div_Dialog); //加入Div對話框
document.body.removeChild(this.Loading);//移除加載圖片 //html為填充div的內容
if(html!=null){
this.Div_Dialog.innerHTML =html;
}
}; //加載完成事件
this.onreadystatechange = function(e) {
if ((qp_shared.IsIE && this.PageFrame.readyState == "complete") || (!qp_shared.IsIE)) {
//清空事件
if (this.PageFrame.onreadystatechange != null)
this.PageFrame.onreadystatechange = null;
//清空事件
if (this.PageFrame.onload != null)
this.PageFrame.onload = null; this.removeLoading();
}
}; //創建一個占位控件
this.renderPlace = function(container) {
var objContainer = el(container);
if (objContainer != null) {
var obj = document.createElement("DIV");
obj.className = "placeEmpty"; objContainer.appendChild(obj);
}
}; //設置窗口大小
this.setWindowSize = function(width, height) {
this.PageFrame.width = this.DivFrame.style.width = width + "px";
this.PageFrame.height = this.DivFrame.style.height = height + "px"; this.DivFrame.style.left = (window.document.documentElement.clientWidth - width) / + "px";
this.DivFrame.style.top = ((window.document.documentElement.clientHeight- height) / + qp_shared.getDocumentScrollTop()) + "px"; this.DivFrame.style.display = "";
}; //設置Div窗口大小
this.setDivWindowSize = function(width, height) {
this.Div_Dialog.width =width + "px";
this.Div_Dialog.height = height + "px"; this.Div_Dialog.style.left = (window.document.documentElement.clientWidth - width) / + "px";
this.Div_Dialog.style.top = ((window.document.documentElement.clientHeight- height) / + qp_shared.getDocumentScrollTop()) + "px"; this.Div_Dialog.style.display = "";
}; //隱藏彈出窗口及遮蓋層
this.hidden = function() {
try {
if (this.DivFrame != null) {
document.body.removeChild(this.DivFrame);
}
}catch(e){}; this.hiddLayer();
this.removeLoading();
}; //只關掉彈出窗口,仍然顯示遮蓋層
this.close = function() {
try {
if (this.DivFrame != null) {
document.body.removeChild(this.DivFrame);
}
}catch(e){};
}; //關掉DIV彈出窗口
this.closeDiv = function () {
try {
if (this.Div_Dialog != null) {
document.body.removeChild(this.Div_Dialog);
this.hiddLayer();
}
} catch (e) {};
}; //隱藏Loading
this.removeLoading = function() {
try {
if (this.Loading != null) {
//當前窗口
var obj = document.getElementById("sysdiv_wait");
if (obj != null) {
document.body.removeChild(obj);
} //父窗口
if (window.parent != null) {
obj = window.parent.document.getElementById("sysdiv_wait");
if (obj != null) {
window.parent.document.body.removeChild(obj);
}
}
}
}catch(e){};
}; //顯示彈出窗口
this.show = function(url, width, height, showPlace, cssName) {
//顯示一個占位控件
if (showPlace != null && showPlace != "") {
this.renderPlace(showPlace);
}; //如果有自定css
if (cssName != null) {
this.CssName = cssName;
}; //為了你防止緩存加了一個隨機數
this.Render(qp_shared.getRandomUrl(url), width, height); this.showLayer(); this.setWindowSize(width, height);
}; //彈出DIV
this.showDivDialog = function (width, height, html) { this.showLayer();
this.RenderDiv(width, height, html);
this.setDivWindowSize(width, height);
} }; var oPopup = new Popup();
js彈出層或者js彈出引用url Frame 層的更多相关文章
- 玩转Bootstrap(JS插件篇)-第1章 模态弹出框 :1-3 模态弹出框
模态弹出框(Modals) 这一小节我们先来讲解一个“模态弹出框”,插件的源文件:modal.js. 右侧代码编辑器(30行)就是单独引入 bootstrap 中发布出的“modal.js”文件. 样 ...
- js比较两个String字符串找出不同,并将不同处高亮显示
根据java代码改写成js,下边js文件代码: function StringBuffer() { this.__strings__ = []; }; StringBuffer.prototype.a ...
- JavaScript:用JS实现加载页面前弹出模态框
用JS实现加载页面前弹出模态框 主要的JavaScript 代码是: <script> //加载模态框 $('#myModal').modal(); $(document).ready(f ...
- 文字添加响应事件,js动态加载CSS, js弹出DIV
文字添加响应事件,js动态加载CSS, js弹出DIV <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN&qu ...
- css+html+js实现多级下拉和弹出菜单
本文将使用css+html+js实现横向菜单.具有多级弹出菜单下拉. 首先我们来看看效果图: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvajkwMzgy ...
- 《JS高程》-教你如何写出可维护的代码
1.前言 在平时工作开发中,大部分开发人员都花费大量的时间在维护其他人员的代码.很难从头开始开发新代码,很多情况下都是以他人成果为基础的,或者新增修改需求,自己写的代码也会被其他开发人员调用,所以 ...
- 弹出框 popover.js
弹出框 popover.js 为任意元素添加一小块浮层,就像 iPad 上一样,用于存放非主要信息. 弹出框的标题和内容的长度都是零的话将永远不会被显示出来. 插件依赖 弹出框依赖 工具提示插件 ,因 ...
- JS轻松实现单击文本框弹出选择日期
我的开发工具是vs2005,你们可选择自己合适的开发工具 首先创建个文本框<input id="txFDate" name="txFDate" type= ...
- jquery,js引入css文件,js引入头尾
jquery,js引入css文件,js引入头尾 今天在项目中,需要把20多个页面加上头和尾部,头和尾是我写的,所以小师傅把这个工作交给我了. 我开始往里面加,先引入common.css,在body开始 ...
随机推荐
- python selenium +autoit实现文件上传 --实践
upload.html <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type&q ...
- Chrome英文版离线安装包下载
在原来在线安装地址后面加上 ?standalone=1 即可 https://www.google.com/intl/en/chrome/browser/desktop/index.html?st ...
- WebDav的java客户端开发包:sardine
最近需要对WebDav服务器进行操作,查找了一下,基于java的开发包主要有这几个: slide Jackrabbit sardine webdavclient4j 其中slide是apache的一个 ...
- Python ceil() 函数
描述 ceil(x) 函数返回一个大于或等于 x 的的最小整数(向上取整). 语法 以下是 ceil() 方法的语法: import math math.ceil( x ) 注意:ceil()是不能直 ...
- navicat 快速复制表所有字段
查询-新建查询-查询创建工具-选择表-全选字段-查询编辑器
- Vuejs2.0 + bootstrap demo
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Linux 共享库(动态库)
Linux 系统上有两类根本不同的 Linux 可执行程序.第一类是静态链接的可执行程序.静态可执行程序包含执行所需的所有函数 — 换句话说,它们是“完整的”.因为这一原因,静态可执行程序不依赖任何外 ...
- C++中虚基类在派生类中的内存布局
今天重温C++的知识,当看到虚基类这点的时候,那时候也没有太过追究,就是知道虚基类是消除了类继承之间的二义性问题而已,可是很是好奇,它是怎么消除的,内存布局是怎么分配的呢?于是就深入研究了一下,具体的 ...
- 428. Pow(x, n)【medium】
Implement pow(x, n). Notice You don't need to care about the precision of your answer, it's acceptab ...
- 去除img、video之间默认间隔的几种方法
img,video{ /*第1种方式*/ border: ; vertical-align: bottom; /*第2种方式*/ outline-width:0px; vertical-align:t ...