Div masking select solution (simple)

Source: Internet
Author: User

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

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.