Solve the control occlusion problem: there are window elements and no window Elements

Source: Internet
Author: User

I don't know if my friends have ever encountered the control occlusion problem. The most typical issue is DropdownList and ActiveX occlusion. The z-index of HTML is used to solve this problem, but it is not feasible to directly set this attribute, this involves the problem of window elements and window elements.

Window elements include the following types:
<Object>, ActiveX control, Plug-ins, DHTML Scriptlets, SELECT elements (HTML representation of DropdownList), IFRAMEs before IE5.01

Windowless elements include:
Windowless ActiveX controls, IFRAMEs after IE5.5, and most DHTML Elements

Among them, ActiveX controls are worth mentioning. By default, VB and MFC controls have windows, while ATL controls do not, however, ActiveX controls are implemented as windowless elements and are actually classified into windowless elements.

No matter how the container is set, all window elements will appear on the element without a window, and the elements with and without a window will follow the z-index attribute, they will be drawn on different planes for display. Setting z-index can only work on the plane where they are located, and the plane with window elements is always above the plane without window elements.

The idea of solving the occlusion problem is very simple. We encapsulate our elements into a DIV, and the code example is as follows:

<DIV id = "PAL2" style = "DISPLAY: inline; Z-INDEX: 8; LEFT: 80px; WIDTH: 360px; POSITION: absolute; TOP: 80px; HEIGHT: 168px">
<OBJECT id = "dhtmltest" style = "Z-INDEX: 8; WIDTH: 352px; HEIGHT: 168px" type = "text/x-scriptlet" data = "TestDivDropdownList.htm" VIEWASTEXT>
</OBJECT> </DIV>

DIV's z-index is 8, and then the SELECT z-index is adjusted to 7 (only smaller than DIV's z-index ).

Related Article

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.