Universal Pop-up page (compatible with IE, Firefox) to turn off the control of wide-height and shielding background _jsp programming

Source: Internet
Author: User
Tags visibility
<%...@ page contenttype= "text/html; Charset=utf-8 "language=" java "import=" java.sql.* "errorpage=" "%>"
<%.../*
Generic pop-up layer page (ie, Firefox compatible)
Description
1.openWindows (width,height)----Open the function of the pop-up layer call to control the width and height of the layer
2.hiddenWindows ()----Turn off the pop-up layer call function
3._displayselect ()----Hide the dropdown box label because it's too high priority
4.<div id= "Lockwindows" >----to implement the page below the masking pop-up layer
5.<div id= "Windowdiv" >----to display the contents of the pop-up layer
Examples (spaces themselves removed):
Page references <%@ include file= "in need of a pop-up layer". /common/common_openwindows.jsp "% >
< input type= "button" onclick= "OpenWindows" (' A ', ') "value=" edit "/>
< input type= "button" onclick= "Hiddenwindows ();" value= "Off"/>
*/%>
Copy Code code as follows:

<style type= "Text/css" ....
#LockWindows {...} {
Position:absolute; top:10px; left:10px; Background-color: #777777; Z-index:2; Display:none;
/**//* Moz Family Use private properties-moz-opacity:0.70 * *
/**//* IE Use private property filter
/**//* Standard properties Opacity support CSS3 browsers (also supported by FF 1.5) * *
opacity:0.70;
Filter:progid:DXImageTransform.Microsoft.Alpha (style=0,opacity=70,finishopacity=100);
Width:expression (Documentelement.clientwidth < 900? Documentelement.clientwidth==0? (body.clientwidth<900? ') 900 ': ' Auto '): ' 900px '): ' auto ');
}
#WindowDIV {...} {Position:absolute z-index:3; Background-color: #FFFFFF; border: #000000 solid 1px; display:none;}
</style>

<script type= "Text/javascript" ....
Hide the Drop-down box to resolve the problem that the dropdown box is too high priority.
Copy Code code as follows:

function _displayselect () ... {
var selects=document.getelementsbytagname ("select");//All dropdown boxes for the entire page
var objwindow = $ ("Windowdiv");
var divselects = objwindow.getelementsbytagname ("select");//All dropdown boxes for the entire pop-up layer
for (Var i=0;i<selects.length;i++) ... {
if (selects[i].style.visibility) ... {
Selects[i].style.visibility= "";
}else ... {
Selects[i].style.visibility= "hidden";
for (var j=0; i<divselects.length; j + +) ... {
Divselects[j].style.visibility= "";
}
}
}
}
function OpenWindows (width,height) ... {
var objwindow = $ ("Windowdiv");
var Objlock = $ ("lockwindows");//This is used to screen content in IE
objlock.style.display= "Block";
objlock.style.width=document.body.clientwidth+ "px";
objlock.style.height=document.body.clientheight+ "px";
objlock.style.minwidth=document.body.clientwidth+ "px";
objlock.style.minheight=document.body.clientheight+ "px";
Determines whether the width and height of the input are greater than the width and height of the current browser
if (width>document.body.clientwidth) width = document.body.clientwidth+ "px";
if (height>document.body.clientheight) height = document.body.clientheight+ "px";
objwindow.style.display= ' block ';
ObjWindow.style.width = width+ "px";
ObjWindow.style.height = height+ "px";
Center the pop-up layer
objwindow.style.left= (document.body.offsetwidth-width)/2+ "px";
objwindow.style.top= (document.body.offsetheight-height)/2+ "px";
_displayselect ();
}
function Hiddenwindows () ... {
$ ("Lockwindows"). style.display= ' None ';
$ ("Windowdiv"). style.display= ' None ';
_displayselect ();
}
</script>
<div id= "Lockwindows" > </div>
<div id= "Windowdiv" >
<%...@ include file= ". /examination/openediterdiv.jsp "%>
</div>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.