In IE6 and later versions, select box will overwrite the content in Div
In general, you can put the displayed content in IFRAME and then display the content in the framework. IFRAME can be displayed on the select upper layer to solve this problem. However, this is troublesome in implementation.
The solution is to add an undisplayed IFRAME framework to the DIV content without modifying other content. Added the following sentence:
<IFRAME Style = "position: absolute; Z-index:-1; width: 100px;" frameborder = "0" src = "about: blank"> </iframe>
In ie, the layer div is overwritten by the Select in the drop-down box. This is one of the bugs in IE, because the select priority level is higher than that in Div. Therefore, no matter how you use the CSS attribute Z-index settings, it is useless.
Therefore, there are two solutions:
Hide all select
Make the content in the DIV higher than the select priority
The first method is obviously troublesome, especially when the SELECT statement is too many and its position is not fixed, it is easy to hide what should not be hidden.
The second time is better. The commonly used HTML controls with a higher priority than select have object and IFRAME, which is better for me to use IFRAME.
The principle is to add an IFRAME to the DIV type and write the content to be displayed to the body of the IFRAME.
ReferenceCodeAs follows:
VaR oiframe = Document. createelement ("<IFRAME name =/" oiframefilter/"frameborder =/" 0/"> </iframe> ")
If (odivfilter. Children. length! = 0) odivfilter. removechild (odivfilter. Children (0 ));
Odivfilter. appendchild (oiframe );
Registry.frames=oiframe.name=.doc ument. Write ("<LINK rel =/" stylesheet/"href =/"/style/css.css/"type =/" text/CSS/"> ");
Sbody = "<Table> <tr> <TD> hahaha </TD> </tr> </table> ";
Registry.frames=oiframe.name=.doc ument. Write (sbody );
In addition, note that the attribute allowtransparency of IFRAME cannot be reused, because transparency invalidates the higher priority of IFRAME.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/URL/archive/2005/04/27/365525.aspx