Use JS to do div pop-up layer, generally in IE can not mask ActiveX control, at the same time under the IE6 select also can't cover. ActiveX defaults are always displayed at the top level in IE, so it is not possible to change the mask relationship by setting the Z-index property of the style. In the information system software, many occasions because of performance, operation and other reasons, often use ActiveX instead of HTML to complete the function
The code is as follows |
Copy Code |
var sd = XX.style.display; XX.style.display = "None"; ... Display after closing the pop-up layer XX.style.display = SD; |
The easiest way to think of this is to hide the control's object before the div layer pops up, and then display it after the layer is closed. If it is simple to be a page, but if there are more than one iframe nesting, for other IFRAME also exist control is more troublesome.
After IE6 version there is called Shim solution, the basic idea is this, in the current page dynamically create an IFRAME, its z-index than the current is higher, then this IFRAME will appear at the top, Then will be the pop-up div z-index set than this IFRAME to be high, at this time the pop-up div can cover the ActiveX control, schematic see the following diagram (the actual div is coincident with the IFRAME).
Of course also need to set some necessary properties, the key is to set the SRC attribute of the IFRAME as Javascript:false, and set display to none, transparency is 0.
The code is as follows |
Copy Code |
Popdiv is the pop-up layer, Nowindex is the current Z-index popdiv.style.zindex=nowindex+1; Add an iframe to cover the ActiveX if ($get ("__iframebodycover" + winname) ==null) { var iframebodycover = document.createelement ("iframe"); Iframebodycover.id = "__iframebodycover" +winname; IframeBodyCover.style.cssText = "Position:absolute;top:0;left:0;width:" + document.body.clientwidth+ "px"; Height: "+ document.body.clientHeight +" Px;background-color: #000000; Filter:alpha (opacity=0);d isplay:none; "; IFRAMEBODYCOVER.SRC = "javascript:false;"; Document.body.appendChild (Iframebodycover); } The z-index of an IFRAME is lower than that of a div. $get ("__iframebodycover" + winname). Style.zindex = Nowindex; Of course at this time under the IE6 naturally also can cover select, the need for friends can refer to. |