spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / dhtml / diner / seethru


Search
The Business Internet

Developer News
MicrosoftÂ’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
Red Hat Heads For The JON 2.0

Positioned Elements and OS Controls, Applets and Plug-ins


This article was originally written in September of 1998, close to four years ago. Since then many new versions of NS and IE have appeared on all platforms. Completely new browsers like Opera and Konqueror are steadily being adopted by many users.

Unfortunately, the problems originally discussed in this article still exist, although possibly not to the degree that they did back then. DHTML authoring has grown exponentially in this time, so a review and update of the problem seems warranted.

The Problem Illustrated

The bordered element above right is a draggable positioned element. Grab it and move it over the SELECT form element below. What happens? Probably not the first time you've seen this behavior. The SELECT element shows through the draggable layer. The best behavior is in NS6.1+ where only the scrollbars show through. All browsers, however, have some problem with SELECT elements.

The Problem Stated

There are certain elements that "float above" HTML elements.

  • This is not a "z-index" issue.

  • There is no fix.

  • There are authoring workarounds, but they are not in the scope of this article.

In this article, we will demonstrate this problem, in full. Hopefully, it will give you a better understanding of what to avoid when developing DHTML pages.

The Problem Demystified

When HTML first introduced the use of forms, it called upon already-existing controls within the operating system to display form elements. A checkbox, a text input, a drop-down SELECT menu, or any other form element, was created by placing the operating system's built-in checkbox, text input, or menu in a Web page. That is, although they are called through HTML, they are not created by HTML, as say, a heading or a paragraph is. The easiest way to prove this is to view form elements on different platforms. They always correspond to the platform standard, not to anything you have coded.

In addition to form elements, the same behavior is witnessed with Java applets, Active-X controls and plug-ins, all of which are external components placed in the HTML page.

This "floating" had not been an issue, however, until the advent of DHTML and the introduction of positioned elements. Authors now find that they cannot position their elements over certain other elements, without having holes "bored" into the positioned elements.

Previously on DHTML Lab

This problem was first mentioned in our first Drag and Drop column, where the draggable positioned elements could be dragged over a persistent INPUT button.

More recently, users of our popular HM script have written to complain that the menus were not hiding the Java applet that co-existed on the page, or the form elements, or plug-ins. A workaround was suggested in Column 36: evaluate_upon_tree_show evaluate_upon_tree_hide.

What the Big Guys Say

Netscape has documented this behavior since the first beta release of Communicator 4. (the italics are mine)

"Layers can contain form elements, applets, and plug-ins, which are known as windowed elements. These elements are special in that they float to the top of all other layers, even if their containing layer is obscured."

Netscape Docs

Microsoft explains the behavior in this way:

"This element is a windowed control and does not support the z-index attribute or zIndex property."

MSDN SELECT Docs
"The property does not apply to windowed controls, such as select objects."

MSDN z-index Docs
"As of Microsoft® Internet Explorer 5.5, the iframe object is windowless and supports the zIndex property. In earlier versions of Internet Explorer, the iframe object is windowed and, like all windowed controls, ignores the zIndex property. If you maintain Web pages that were designed for earlier versions of Internet Explorer that do not support the zIndex property, you might want to redesign the pages, especially if the pages contain iframe objects that are stacked on top of windowed controls, such as select objects. You can use the visibility attribute to hide windowed controls that you want an iframe object to overlap. You can also position windowed controls so that iframe objects do not overlap them."

MSDN IFRAME Docs

This Article

In this article, we will demonstrate these "special" and "windowed" elements. It would be best if you could test the behavior in several browsers/versions, although the differences will be mentioned.

We will look at HTML element behavior, when positioned over:

Again, there is no fix. This article exists only to save you the hassle of creating test pages, by demonstrating the problem in full.

First, a look at form elements.



Produced by Peter Belesis and



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Perl Pragma Primer · Implement Drag and Drop in Your Web Apps: Part 2 · How to Create an Ajax Autocomplete Text Field: Part 5
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
SQL Server 2005 Express Edition - Part 22 - Upgrading from Microsoft SQL Server Desktop Engine (MSDE) · Vyatta: Downgrades that Pay Off · NetMotion Brings Cross-Network Support to Wireless VoIP

All Rights Reserved. Legal Notices.
Created: Sept 20, 1998
Revised: August 25, 2003

URL: http://www.webreference.com/dhtml/diner/seethru/



I'm a draggable positioned element (layer).
---
Grab and drag me over the SELECT element on this page.