Copy code code as follows:
// ------------------------------------------
// Popdivid: The ID of the layer div
// Dragdivid: Used to drag the ID of the DIV
// iSshowmask: Whether the mask layer is displayed
function popDivShow(popDivId, dragDivId, isShowMask) {
if (ISSHOWMASK) {
Creatmask (Popdivid);
}
var own = document.GetelementByid (Popdivid);
var own_tital = document.GetelementByid (Dragdivid);
var bdrag = false;
Var Disx = Disy = 0;
owins.style.display = "block";
owins_tital.onmousedown = Function (Event) {{
var every = event || window.event;
bdrag = true;
disx = event.clientx -owins.offsetlect;
disy = event.clienty -owins.offsettop;
this.setCapture &&S.Setcapture ();
Return false;
};
document.onMousemove = Function (Event) {
if (! BDRAG)
Return;
var every = event || window.event;
var IL = Event.clientx -DISX;
var it = event.clienty -disy;
var maxl = document.documentedLement.clientWidth -Owins.OffsetWidth;
var maxt = document.documentedLement.clientheight -owins.offsetheight;
IL = IL <0? 0: IL;
IL = IL> Maxl? Maxl: IL;
IT = IT <0? 0: IT;
it = it> maxt? Maxt: it;
owins.style.margintop = owins.style.marginleft = 0;
owins.style.left = IL + "PX";
owins.style.top = it + "px";
Return false;
};
document.onMouseup = Window.onblur = Owins_title.onLoseCapture = Function () {
bdrag = false;
Owins_tital.releasecapture &&PINS_TITLE.ReleaseCapture ();
};
}
// Hide the pop -up layer
Function Popdivhidden (Popdivid) {{
var own = document.GetelementByid (Popdivid);
owins.style.display = "None";
Window.parent.document.body.Removechild (window.parent.document.GetelementByid ("Maskdiv")
}
// Get the pop -up layer Zindex
Function Getzindex (Popdivid) {
varpoDIV = document.GetelementByid (Popdivid);
varpoDivzindex = Popdiv.style.zindex;
Return Popdivzindex;
}
// Create a mask layer
Function Creatmask (Popdivid) {{
// Parameter W is the width of the pop -up page, parameter H is the height of the pop -up page, parameter S is the path of the pop -up page
var maskdiv = window.parent.document.createElement ("div");
maskdiv.id = "Maskdiv";
maskdiv.style.position = "fixed";
maskdiv.style.top = "0";
maskdiv.style.left = "0";
maskdiv.style.zindex = Getzindex (Popdivid) -1;
Maskdiv.style.BackgroundColor = "#333";
Maskdiv.style.filter = "alpha (opacity = 70)";
Maskdiv.style.oPacity = "0.7";
maskdiv.style.width = "100%";
Maskdiv.style.head = (Window.parent.document.body.scrollHeight + 50) + "px";
window.parent.document.body.appendchild (Maskdiv);
Maskdiv.onMousedown = Function () {
Window.parent.document.body.Removechild (window.parent.document.GetelementByid ("Maskdiv")
};
}