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开始 ...
随机推荐
- 手机网络抓包 转载记录http://blog.csdn.net/skylin19840101/article/details/43485911
Fiddler不但能截获各种浏览器发出的HTTP请求, 也可以截获各种智能手机发出的HTTP/HTTPS请求.Fiddler能捕获IOS设备发出的请求,比如IPhone, IPad, MacBook. ...
- pythonl练习笔记——爬虫的初级、中级、高级所匹配的知识
1 初级爬虫 (1)Web前端的知识:HTML, CSS, JavaScript, DOM, DHTML, Ajax, jQuery,json等: (2)正则表达式,能提取正常一般网页中想要的信息,比 ...
- 从错误中学python(4)——最小公约数与辗转相除法
题目 给你两个正整数a和b, 输出它们的最大公约数 辗转相除法 辗转相除法的步骤 def gcd(b,a): b,a=a,b%a if a==0: return b else: return gcd( ...
- ISCC2014-reverse
这是我做reverse的题解.在咱逆向之路上的mark一下,,水平有限,大牛见笑. 题目及题解链接:http://pan.baidu.com/s/1gd3k2RL 宗女齐姜 果然是仅仅有50分的难度, ...
- jsp指令和重定向
1 声明指令 格式:<%!声明变量或函数 %> 作用:会生成一个成员变量或成员方法,也可以使用访问修饰符修饰,public,private,protected 2 注释指令 格式:< ...
- Azure 怎么开通FTP
1. 需要在Azure Portal设置端口:21, 1035, 1036, 1037,1038,1039,1040 2. 需要内网放开端口:21, 1035, 1036, 1037,1038,103 ...
- Java:集合,对列表(List)中的数据(整型、字符串、日期等)进行排序(正序、倒序)的方法;字符串按照整型排序的方法
1. 要求 对List列表中的数据进行排序(正序.倒序),列表中的数据包括:整型(Integer).字符串(String).日期(Date)等.对于字符串,要求允许对它按照整型进行排序. 2. 实现思 ...
- window 2008 定时任务调用bat不成功的解决方法
之前一直有在一台XP的机器上调用定时任务.如今这台机器换成了window 2008的操作系统,调用一直不成功.只是在偶然之间攻克了. 选择"任务计划程序" 任务计划程序库 ...
- Linux 共享库(动态库)
Linux 系统上有两类根本不同的 Linux 可执行程序.第一类是静态链接的可执行程序.静态可执行程序包含执行所需的所有函数 — 换句话说,它们是“完整的”.因为这一原因,静态可执行程序不依赖任何外 ...
- Spring Cloud Summary
Spring Cloud Summary https://cloud.spring.io/spring-cloud-static/Finchley.RC1/single/spring-cloud.ht ...