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开始 ...
随机推荐
- 1.Java基础-面向对象编程思想(封装继承多态接口)
封装: 1.定义:隐藏对象的属性和实现细节,仅对外公开接口,控制在程序中属性的读和修改的访问级别. 2.封装的目的是:增强安全性和简化编程,使用者不必了解具体的实现细节,而只是要通过外部接口,一特定的 ...
- pythonl练习笔记——爬虫的初级、中级、高级所匹配的知识
1 初级爬虫 (1)Web前端的知识:HTML, CSS, JavaScript, DOM, DHTML, Ajax, jQuery,json等: (2)正则表达式,能提取正常一般网页中想要的信息,比 ...
- map+pair Bayan 2015 Contest Warm Up D题
D. CGCDSSQ time limit per test 2 seconds memory limit per test 256 megabytes input standard input ou ...
- 为ubuntu添加多媒体以及flash等等常用包
因为多媒体mp3,mp4以及flash等等都是一些有版权的东东,ubuntu不能直接集成到安装盘内,所以,做了2个常用包,来存放它们. ubuntu-restricted-addons ubuntu- ...
- Let's call it a "return"
Preface Long time no see. For some reason that I failed to keep updating this blog, which is really ...
- Linux下修改时间时区的方法介绍
点评:在Linux中,用于时钟查看和设置的命令主要有date.hwclock和clock.其中,clock和 hwclock用法相近,只不过clock命令除了支持x86硬件体系外,还支持Alpha硬件 ...
- 【Android】11.5 创建和管理Fragments
分类:C#.Android.VS2015: 创建日期:2016-02-22 一.简介 想要管理activity中的fragment,可以用FragmentManager类来实现.通过在activity ...
- angular学习笔记(九)-css类和样式3
再来看一个选择li列表的例子: 点击li中的任意项,被点击的li高亮显示: <!DOCTYPE html> <html ng-app> <head> <tit ...
- 解决MAC下ctags -R无效的问题
MAC下自带了ctags,与我们常用的是不同的. 我们需要去重新下载一个ctags并重新安装 1.去http://ctags.sourceforge.net/下载Ctags的最新版本源代码 2.tar ...
- arm程序的反汇编程序
这是汇编源文件: MCU:S3C2440(arm920T) 代码实现点亮个led小灯 .text .global _start _start: ldr r0,=0x56000010 @GPBCON m ...