473,785 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

z-index layering problem in IE6

9 New Member
Hi

I have a problem, which after browsing through Google, seems to be fairly common.

However having tried most suggestions I am still getting the problem.

I have a menu bar across the top of my page. As I click on each menu option a further list of links is displayed below it.

Now in IE7 where I click on a menu option that has a large number of links below it it appears layered correctly over the top of the controls below.

However in IE6 some of the controls are superimposed over the top of the menu options.

The menu is defined within a table row like this with z:index: 300.

Expand|Select|Wrap|Line Numbers
  1.  
  2. <tr bgcolor="#999999">
  3.                 <td style="z-index: 300; width: 1581px" colspan="3">
  4.  
  5.                     <script>
  6.                             document.write(menuBar);
  7.                     </script>
  8.  
  9.                 </td>
  10.                 <td style="width: 770px" align="right">
  11.                     <div id="lblReportTitle" style="display: inline; font-weight: bold; font-size: 10pt;
  12.                         font-family: Arial; text-align: right" align="right">
  13.                     </div>
  14.                 </td>
  15.                 <td align="right" colspan="1">
  16.                     <div id="lblSelNodeImgURL" style="display: none; font-weight: bold; font-size: 10pt;
  17.                         font-family: Arial; text-align: right" align="right" >
  18.                     </div>
  19.                 </td>
  20.             </tr>
  21.  
  22.  

The controls are within a div within an iframe with z-index -1.

Expand|Select|Wrap|Line Numbers
  1.  
  2.    <div id="dvForm" style="z-index:-1; width:95%; left:30px; top:0px; position : absolute;">
  3.             <input type="submit" name="btnPrnt" value="Print" id="btnPrnt" style="height:24px;width:88px;z-index: 150; left: 113px; position: absolute; top: 184px" />
  4.             <div id="divPrnt">
  5.                 <span id="Label1" style="font-weight:bold;z-index: 105; left: 16px; position: absolute; top: 0px"> Month</span>
  6.                 <iframe id="calGraphFrame" scrolling="no" style="z-index: 101; left: 0px; width: 761px;
  7.                     position: absolute; top: 208px; height: 326px" name="calGraphFrame" src="CalendarGraph.aspx?Ref=123"
  8.                     frameborder="no" width="761" height="88%"></iframe>
  9.                 <input name="tbSelectedNode" type="hidden" id="tbSelectedNode" style="z-index: 114; left: 528px; width: 24px; position: absolute;
  10.                     top: 176px; height: 22px" size="1" />
  11.                 <span id="Label2" style="font-weight:bold;z-index: 106; left: 112px; position: absolute; top: 0px"> Year</span>
  12.                 <span id="Label3" style="font-weight:bold;z-index: 107; left: 184px; position: absolute; top: 0px"> Utility Type</span>
  13.                 &nbsp;
  14.                 <select name="ddMonth" id="ddMonth" style="z-index: -1; left: 16px; position: absolute;
  15.                     top: 16px">
  16.     <option value="January">January</option>
  17.     <option value="February">February</option>
  18.     <option value="March">March</option>
  19.     <option value="April">April</option>
  20.     <option value="May">May</option>
  21.     <option value="June">June</option>
  22.     <option value="July">July</option>
  23.     <option value="August">August</option>
  24.     <option value="September">September</option>
  25.     <option selected="selected" value="October">October</option>
  26.     <option value="November">November</option>
  27.     <option value="December">December</option>
  28.  
  29. </select>
  30.                 <select name="ddYear" id="ddYear" style="width:56px;z-index: 103; left: 112px; position: absolute;
  31.                     top: 16px">
  32.     <option value="2000">2000</option>
  33.     <option value="2001">2001</option>
  34.     <option value="2002">2002</option>
  35.     <option value="2003">2003</option>
  36.     <option value="2004">2004</option>
  37.     <option value="2005">2005</option>
  38.     <option value="2006">2006</option>
  39.     <option selected="selected" value="2007">2007</option>
  40.  
  41. </select>
  42.                 <input type="submit" name="btnClearChart" value="Clear Chart" onclick="SetOverlayCount(1);" language="javascript" id="btnClearChart" style="z-index: 108; left: 16px; position: absolute;
  43.                     top: 184px" />
  44.                 <select name="rbUtilityList" id="rbUtilityList" style="font-size:10pt;z-index: 104; left: 184px; position: absolute;
  45.                     top: 16px">
  46.     <option selected="selected" value="1">Electricity</option>
  47.     <option value="2">Gas</option>
  48.     <option value="3">Water</option>
  49.     <option value="4">Heating</option>
  50.     <option value="5">Cooling</option>
  51.     <option value="6">Effluent</option>
  52.     <option value="7">Comp. Air</option>
  53.     <option value="9">Steam</option>
  54.  
  55. </select>
  56.                 <table id="rbMeterList" border="0" style="font-size:10pt;z-index: 109; left: 288px; position: absolute;
  57.                     top: 16px">
  58.     <tr>
  59.         <td><input id="rbMeterList_0" type="radio" name="rbMeterList" value="Utility" checked="checked" /><label for="rbMeterList_0">Utility</label></td>
  60.     </tr><tr>
  61.         <td><input id="rbMeterList_1" type="radio" name="rbMeterList" value="SubMeter" /><label for="rbMeterList_1">SubMeter</label></td>
  62.     </tr>
  63. </table>
  64.  
  65.  
  66.  
Does anyone know what I can do to get this looking OK in IE6. I’ve tried upping the z-index on the menu bar and decreasing it on the div and the controls but the dropdown list always pokes through.

You can see both IE6 and IE7 images here:

IE6

IE7



Thanks in advance.
Oct 15 '07 #1
5 14249
drhowarddrfine
7,435 Recognized Expert Expert
I saw and fixed this problem, twice, about a year ago. Never saw it again until about four times recently. I'll be darned if I can't remember what I did and I swore I would make a note but can't find it. I believe it had something to do with placing 'position:relat ive' on one of the elements but don't recall which one. Of course, that could be wrong.

Very busy day today. Try and get back to it tonight.
Oct 15 '07 #2
drhowarddrfine
7,435 Recognized Expert Expert
Do you have an online link to this?
Oct 16 '07 #3
steven
143 New Member
http://support.microso ft.com/default.aspx?sc id=kb;en-us;177378

This is a known issue and unfortunately, there's no 'nice' fix for IE6. The most common way to get around this issue, is to use a hack and dynamically create and place an iframe over the form control when the menu/element should be overlapping the control. The iframe should have a z-index higher than the form/controls but lower than the overlapping element (the drop down menu, in your case). It's known as the 'iframe shim'. =]

Here are a couple of google search results looking for the iframe fix

http://www.codeproject .com/useritems/dropdown_div.as p

http://www.soxiam.com/Code/UsingIframeShim ToCoverOverForm SelectBoxes

Good luck.
Oct 16 '07 #4
lightgram
9 New Member
Hi

I've tried both solutions suggested and still have the problem:

My iframe and div look like this:

Expand|Select|Wrap|Line Numbers
  1.  <iframe id="DivShim" style="z-index: 901; left: 0px; position: absolute; top: 0px;
  2.             width: 100%;" frameborder="0"></iframe>
  3.         <div id="PopUpDiv" style="z-index: 915; left: 0px; position: absolute; top: 0px;
  4.             width: 100%;">........
  5.  
  6. <table>.....
  7.  
  8.  <tr bgcolor="#999999">
  9.                     <td style="width: 1581px; z-index:992;" colspan="3">
  10.  
  11.                         <script>
  12.                             document.write(menuBar);
  13.                         </script>
  14.  
  15.                     </td>
  16.  
  17. </table>
  18. </div>
  19.  
  20.  <script type="text/javascript">    
  21.  
  22.  DivSetVisible(true) 
  23.  
  24. </script>
  25.  
  26.  <script type="text/javascript">    
  27.  function DivSetVisible(state)
  28.               {
  29.                var DivRef = document.getElementById('PopupDiv');
  30.                var IfrRef = document.getElementById('DivShim');
  31.                if(state)
  32.                {
  33.                 DivRef.style.display = "block";
  34.                 IfrRef.style.width = DivRef.offsetWidth;
  35.                 IfrRef.style.height = DivRef.offsetHeight;
  36.                 IfrRef.style.top = DivRef.style.top;
  37.                 IfrRef.style.left = DivRef.style.left;
  38.                 IfrRef.style.zIndex = DivRef.style.zIndex - 1;
  39.                 IfrRef.style.display = "block";
  40.                }
  41.                else
  42.                {
  43.                 DivRef.style.display = "none";
  44.                 IfrRef.style.display = "none";
  45.                }
  46.               }
  47.  
  48. </script>
  49.  


The control causing the problem is within the main iframe:

Expand|Select|Wrap|Line Numbers
  1. <iframe id="mainFrame" style="z-index: -1; left: 208px; width: 761px; position: absolute;
  2.             top: 72px; height: 600px" name="mainFrame" src="<%=strFrameData%>" frameborder="0"
  3.             width="761" height="85%"></iframe>
  4.  

and is defined within it's own page form:

Expand|Select|Wrap|Line Numbers
  1. <form id="Form1" style="font-size: 10pt; font-family: Arial" method="post" runat="server">
  2.  
  3. <asp:DropDownList ID="ddMonth" Style="z-index: 909; left: 16px; position: absolute;
  4.                     top: 16px" runat="server" OnSelectedIndexChanged="DateChange" meta:resourcekey="ddMonthResource2">
  5.                     <asp:ListItem Value="January" ......
  6.  
  7.                 </asp:DropDownList>
  8.  
  9. </form>
  10.  

Just cannot seem to get this to work in IE6 - the dropdown list always bleeds through.
Oct 17 '07 #5
drhowarddrfine
7,435 Recognized Expert Expert
On the link you sent me, the first page has an error. You can only use an id name once per page. It must be unique to one element.
Oct 17 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1429
by: JohnDpatriot | last post by:
After installing XP SP2 on my machine, I continually get the Script Error permission denied when I attempt to adjust the Zindex of an object on the page . see below document.getElementById(document.getElementById('CurrentLayer').value).style.zIndex=1; Before XP SP2 this app worked, and still does on all non-sp2 machines. Any help would be great
1
1639
by: news.verizon.net | last post by:
Hi all, I have a website created by others and sort of meshed together. Here are a couple of links... http://www.ibco.net/honours/rc/ See how the navigation bars on the left come in behind this - is there anyway to tell it to stack it otherwise? http://www.ibco.net/honours/rc/index.asp?showpage=photographs&golfmenu=1 This is the same problem. Here is a site it works on because the slide shows were created differently:...
1
4112
by: Matthew White | last post by:
Hi - From a Javascript beginner: I'd like to display an image in a table cell, and in another cell have 3 or 4 checkboxes. Based on the boxes check, I would "overlay" images on top of the original image in the other table cell. Thanks....
22
10362
by: DJ WIce | last post by:
Hi, I'm looking for a script to get the hi-est z-index on a page. I want my javascript menu to be always on top of the page (moves along on top when you scroll down). Does anyone know how to scann all items/elements on the page for a z-index? Thanks, Wouter
5
1527
by: Razzbar | last post by:
I'm using a div as a floating dialog box. I'd rather use a popup window, but due to all the popup blockers in use, I have to use another method, a div that has absolute positioning. The damn thing won't get in front of dropdown listboxes! I check the currentstyle.zindex of the listoxes, and they're set at 0. I set the div.style.zindex to some higher number, and it doesn't help. I minimize and restore the window, hoping it will redraw...
1
1687
by: Sabbaath | last post by:
But haven't really found anything that answers the issue. Basically, I have a js function that has these lines in it, among others: var navSectionBg = document.getElementById("mainNav_" + whichNav + "Content"); navSectionBg.style.zIndex = newZ; All other changes to the css on the fly happen seemlessly, but the one line setting the zIndex does not work at all.
6
1516
by: ravis64 | last post by:
Hi, I basicaly have a form of 9 images, spread in a 3 x 3 grid. What i need to do is give each image a border and on some of the borders they need to over lap the image a bit in the bottom corner with the word "NEW". So i was wondering in c# .net windows forms is there a way of layering, like one layer of buttons and a layer on top of borders (so that the border can slighlty overlap the button). Is this possible? What is the best way to do...
8
2838
by: dougawells | last post by:
I am having issues using layers due to the different ways that different browsers display them. I need to be able to layer some images together as they work independently of each other. For example - there is an image that is the background. Then, there are images used as buttons/links, then there are images that swap out based on certain clicks. All of these on the same page. Are there other options for layering images without using...
2
2324
by: zz2uk1 | last post by:
Im trying to show a text box above a div in a simple webpage. Im viewing in IE 7 and Chrome and the text box is always below the div, although I have set the zIndex fairly high. I have included my code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Untitled Page</title> <style type="text/css"> ...
1
22453
Claus Mygind
by: Claus Mygind | last post by:
How come I can set this style element document.getElementById("popTime").style.left = "0px"; but not this document.getElementById("freqJobDiv").style.zIndex = "20"; I have two nested division on the screen. I want to use a mouseover to bring the back division to the front. It seems I can get all the style properties to work except for zindex
0
9483
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10346
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10096
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5514
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.