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开始 ...
随机推荐
- C++ 设计模式 —— 訪问者(Visitor)
訪问者设计模式的实现借助于两个继承体系, (1)elements:一个是被操作的类(基类及其子类) (2)visitors:一个定义了一系列操作的訪问者(基类及其子类) 訪问者模式是一种行为型设计模式 ...
- (三)RocketMq入门之独立线程处理业务
一.示例代码 这段代码实现了一个独立线程监听在一个特殊的消息队列上,一旦收到消息就处理并发送给MQ,然后推送给所有的消费者. import com.alibaba.rocketmq.client.ex ...
- opencv源代码分析:icvGetTrainingDataCallback简单介绍
/* *函数icvGetTrainingDataCallback介绍 *功能:对全部样本计算特征编号从first開始的num个特征,并保存到mat里. *输入: *CvMat* mat矩阵样本总数个行 ...
- Android开发4——文件操作模式
一.基本概念 // 上下文对象private Context context; public FileService(Context context){ super(); this.context = ...
- ps曲线
>>曲线的基本原理. 输入:在坐标的底部横着的是输入,显示的是当前图片上的颜色信息. 输出:竖着的是输出线,使我们调整图片的输出结果. 输入和输出轴上都有一条明暗信息,告诉我们那边是阴影那 ...
- spring framework 4 源代码阅读(2)---从ClassPathXmlApplicationContext開始
Application初始化日志 15:23:12.790 [main] DEBUG o.s.core.env.StandardEnvironment - Adding [systemProperti ...
- TRIZ系列-创新原理-9~11-预先反作用原理、预处理原理、预先防范原理
一.预先反作用原理表述例如以下: 1)预先给物体施加反作用,以补偿过量的或者不想要的压力. 假设知道系统在执行过程中,会有不利的或者有害的作用(负面作用)产生,则能够预先採取一定的措施来抵消.控制这样 ...
- 翻翻git之---效果鲜明的类ViewPager库 ConvenientBanner(对图片载入部分进行改动)
转载请注明出处:王亟亟的大牛之路 昨天写了篇基础的View绘制的内容貌似观众老爷们不怎么喜欢.那再这里再安利下自己定义View时.用到Paint Canvas的一些温故.讲讲用路径绘画实现动画效果(基 ...
- python(21)实现多进程(1)
参考链接:http://www.cnblogs.com/kaituorensheng/p/4445418.html python多进程:multiprocessing python中的多线程其实并不是 ...
- 部署hadoop2.7.2 集群 基于zookeeper配置HDFS HA+Federation
转自:http://www.2cto.com/os/201605/510489.html hadoop1的核心组成是两部分,即HDFS和MapReduce.在hadoop2中变为HDFS和Yarn.新 ...