Universal popup layer page of compatible with IE and firefox can be turned off to control width and height and screen background
- 2020-05-17 06:08:45
- OfStack
<
%...@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %
>
< %.../*
General pop-up layer page (compatible with IE and firefox)
Description:
1.openWindows(width,height)-- open the function called by the pop-up layer to control the width and height of the layer
2.hiddenWindows()-- close the pop-up layer to call the function
3._displaySelect()-- hide the drop-down box tag because it is too high a priority
4. < div id="LockWindows" > -- used to mask pages below the popup layer
5. < div id="WindowDIV" > -- used to display the contents of the pop-up layer
Example (space removed) :
References on pages that require a pop-up layer < %@ include file="../common/common_openWindows.jsp"% >
< input type = "button" onclick = "openWindows (' 800 ', '700');" value=" edit "/ >
< input type = "button" onclick = "hiddenWindows ();" value=" off "/ >
*/% >
< script type="text/javascript" > ...
// hide the drop-down box to solve the problem of too high priority of the drop-down box,
< %.../*
General pop-up layer page (compatible with IE and firefox)
Description:
1.openWindows(width,height)-- open the function called by the pop-up layer to control the width and height of the layer
2.hiddenWindows()-- close the pop-up layer to call the function
3._displaySelect()-- hide the drop-down box tag because it is too high a priority
4. < div id="LockWindows" > -- used to mask pages below the popup layer
5. < div id="WindowDIV" > -- used to display the contents of the pop-up layer
Example (space removed) :
References on pages that require a pop-up layer < %@ include file="../common/common_openWindows.jsp"% >
< input type = "button" onclick = "openWindows (' 800 ', '700');" value=" edit "/ >
< input type = "button" onclick = "hiddenWindows ();" value=" off "/ >
*/% >
<style type="text/css">...
#LockWindows{...}{
position:absolute; top:10px; left:10px; background-color:#777777; z-index:2; display:none;
/**//* Moz Family Using private properties -moz-opacity: 0.70 */
/**//* IE Using private properties filter */
/**//* Standard properties opacity support CSS3 Browser ( FF 1.5 Also support) */
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 solve the problem of too high priority of the drop-down box,
function _displaySelect()...{
var selects=document.getElementsByTagName("select");// All the drop-down boxes on the entire page
var objWindow = $("WindowDIV");
var DIVselects = objWindow.getElementsByTagName("select");// All drop-down 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 in IE Block the content below
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 if the width and height of the input is 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>