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 層的更多相关文章

  1. 玩转Bootstrap(JS插件篇)-第1章 模态弹出框 :1-3 模态弹出框

    模态弹出框(Modals) 这一小节我们先来讲解一个“模态弹出框”,插件的源文件:modal.js. 右侧代码编辑器(30行)就是单独引入 bootstrap 中发布出的“modal.js”文件. 样 ...

  2. js比较两个String字符串找出不同,并将不同处高亮显示

    根据java代码改写成js,下边js文件代码: function StringBuffer() { this.__strings__ = []; }; StringBuffer.prototype.a ...

  3. JavaScript:用JS实现加载页面前弹出模态框

    用JS实现加载页面前弹出模态框 主要的JavaScript 代码是: <script> //加载模态框 $('#myModal').modal(); $(document).ready(f ...

  4. 文字添加响应事件,js动态加载CSS, js弹出DIV

    文字添加响应事件,js动态加载CSS, js弹出DIV <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN&qu ...

  5. css+html+js实现多级下拉和弹出菜单

    本文将使用css+html+js实现横向菜单.具有多级弹出菜单下拉. 首先我们来看看效果图: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvajkwMzgy ...

  6. 《JS高程》-教你如何写出可维护的代码

    1.前言   在平时工作开发中,大部分开发人员都花费大量的时间在维护其他人员的代码.很难从头开始开发新代码,很多情况下都是以他人成果为基础的,或者新增修改需求,自己写的代码也会被其他开发人员调用,所以 ...

  7. 弹出框 popover.js

    弹出框 popover.js 为任意元素添加一小块浮层,就像 iPad 上一样,用于存放非主要信息. 弹出框的标题和内容的长度都是零的话将永远不会被显示出来. 插件依赖 弹出框依赖 工具提示插件 ,因 ...

  8. JS轻松实现单击文本框弹出选择日期

    我的开发工具是vs2005,你们可选择自己合适的开发工具 首先创建个文本框<input id="txFDate" name="txFDate" type= ...

  9. jquery,js引入css文件,js引入头尾

    jquery,js引入css文件,js引入头尾 今天在项目中,需要把20多个页面加上头和尾部,头和尾是我写的,所以小师傅把这个工作交给我了. 我开始往里面加,先引入common.css,在body开始 ...

随机推荐

  1. Java annotation 自定义注释@interface的用法

    最近看到很多项目都是用了自定义注解,例如 1.什么是注解? 元数据(metadata),就是指数据的数据,元数据是描述数据的,就像数据库中的,表的字段,每一个 字段描述这个字段下面·的数据的含义,j2 ...

  2. Linux内核(6) - 模块机制与“Hello World!

    有一种感动,叫内牛满面,有一种机制,叫模块机制.显然,这种模块机制给那些Linux的发烧友们带来了方便,因为模块机制意味着人们可以把庞大的Linux内核划分为许许多多个小的模块.对于编写设备驱动程序的 ...

  3. Mysql multi实现mysql双实例

    Mysql multi实现mysql双实例 1.添加mysql用户 以root登录,新建mysql用户组 groupadd mysql useradd -d /data/mariadb -g mysq ...

  4. Snail—OC学习之类别Category

    类别就是向类加入一些实用的功能或者方法 利于开发 类能够是系统类.能够是自己定义类 类别跟子类是不一样的.类别仅仅能加入一些方法 属性变量什么的不能够加入 不创建新类,就可以对已有类进行扩展 做项目的 ...

  5. python标准库介绍——2 os.path模块详解

    == os.path 模块 == ``os.path`` 模块包含了各种处理长文件名(路径名)的函数. 先导入 (import) ``os`` 模块, 然后就可以以 ``os.path`` 访问该模块 ...

  6. python标准库介绍——1 os详解

    == os 模块 == ``os`` 模块为许多操作系统函数提供了统一的接口. 这个模块中的大部分函数通过对应平台相关模块实现, 比如 ``posix`` 和 ``nt. os`` 模块会在第一次导入 ...

  7. github初使用

    http://www.eoeandroid.com/thread-274556-1-1.html 其中编写 $ git remote add origin <a href="\&quo ...

  8. B+树在数据库中的应用

    B+树在数据库中的应用 flyfish 2015-7-6 B+树在数据库中的应用重要是实现索引 应用方式一 ID为表的主键,利用主键建立一棵B+树 叶子结点存储记录的地址 应用方式二 ID为表的主键. ...

  9. 网络编程----------SOCKET编程实现简单的TCP协议

    首先我们须要大致了解TCP的几点知识: 1.TCP的特点:面向连接的可靠性传输 2.TCP的三次握手建立连接和四次挥手释放连接.但为什么TCP要三次握手建立连接呢? 答:由于两次握手无法保证可靠性.若 ...

  10. android.content.res.TypedArray-深入理解android自定义属性(AttributeSet,TypedArray)

    属性 自定义属性,首先要定义出来属性,我们新建一个attrs.xml: <?xml version="1.0" encoding="utf-8"?> ...