Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select objects apear over the layers in IE5. 3

Status
Not open for further replies.

torga

Programmer
Apr 28, 2001
11
ES
Hey!
I've been working with layers (using the "div" tag) to make a DHTML menu, but they apear under the "select" objects in IE5. I'm using the z-index property, but it doesn't help. In NS7 works fine... any idea of what's wrong?

P.D: I've tryed all possible combinations of z-index properties.

Thanks a lot for your help!!!
Ton.
 
Did you try to put your select tags inside divs (that are always displayed) on wich you set a z-order ? Water is not bad as long as it stays out human body ;-)
 
Yes, i did it. It didn't work... Have you experienced something similar? I haven't tryed for other versions of IE than 5.0. Could be a bug from this version?
 
If you send me the code I can try with IE 6.0 : martin.hardy@ca-logitaine.fr Water is not bad as long as it stays out human body ;-)
 
here comes a sample code made with macromedia. (I tried to see if there wasn't the problem with their code but it remains)

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot;>
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName==&quot;Netscape&quot;)&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
<style type=&quot;text/css&quot;>
<!--
.navdark {
background-color: #FFF09B;
border: 1px solid #FF9A35;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
z-index: 100;
}
-->
</style>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<div id=&quot;Layer1&quot; style=&quot;position:absolute; left:100px; top:7px; width:140px; height:125px; z-index:1000; visibility: hidden&quot;>
<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; height=&quot;100%&quot; class=&quot;navdark&quot;>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</div>

<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;>
<div style=&quot;z-index:1;&quot;>
<input type=&quot;checkbox&quot; name=&quot;checkbox&quot; value=&quot;checkbox&quot;>
<input type=&quot;checkbox&quot; name=&quot;checkbox2&quot; value=&quot;checkbox&quot;>
<select name=&quot;select2&quot;>
</select>
<select name=&quot;select3&quot;>
</select>
<select name=&quot;select4&quot;>
</select>
<select name=&quot;select5&quot;>
</select>
<select name=&quot;select&quot;>
</select>
<input type=&quot;button&quot; name=&quot;Button&quot; value=&quot;Show&quot; onClick=&quot;MM_showHideLayers('Layer1','','show')&quot;>
<input type=&quot;button&quot; name=&quot;Button&quot; value=&quot;Hide&quot; onClick=&quot;MM_showHideLayers('Layer1','','hide')&quot;>
</div>
</form>

</body>
</html>
 
Ops! There was an error because of the
Code:
[i]
. Now is ok... any idea?

Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot;>
<!--
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName==&quot;Netscape&quot;)&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</script>
<style type=&quot;text/css&quot;>
<!--
.navdark    {
    background-color: #FFF09B;
    border: 1px solid #FF9A35;
     font-family: Verdana, Arial, Helvetica, sans-serif; 
    font-size: 10px;
    z-index: 100;
}
-->
</style>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<div id=&quot;Layer1&quot; style=&quot;position:absolute; left:100px; top:7px; width:140px; height:125px; z-index:1000; visibility: hidden&quot;> 
  <table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; height=&quot;100%&quot; class=&quot;navdark&quot;>
    <tr>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td> </td>
      <td> </td>
      <td> </td>
    </tr>
  </table>
</div>

<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;>
<div style=&quot;z-index:1;&quot;>
  <input type=&quot;checkbox&quot; name=&quot;checkbox&quot; value=&quot;checkbox&quot;>
  <input type=&quot;checkbox&quot; name=&quot;checkbox2&quot; value=&quot;checkbox&quot;>
  <select name=&quot;select2&quot;>
  </select>
  <select name=&quot;select3&quot;>
  </select>
  <select name=&quot;select4&quot;>
  </select>
  <select name=&quot;select5&quot;>
  </select>
  <select name=&quot;select&quot;>
  </select>
    <input type=&quot;button&quot; name=&quot;Button&quot; value=&quot;Show&quot; onClick=&quot;MM_showHideLayers('Layer1','','show')&quot;>
    <input type=&quot;button&quot; name=&quot;Button&quot; value=&quot;Hide&quot; onClick=&quot;MM_showHideLayers('Layer1','','hide')&quot;>
  </div>
</form>

</body>
</html>
 
I can't try it because I can't copy and paste it from tek-tips : all char are changed to their html values &quot;& lt ;&quot; (without the spaces) for &quot;<&quot;, ...). So if you want me to help, send the code the mail adress I gave above. Water is not bad as long as it stays out human body ;-)
 
I heard about this before. IE actually puts another window in front of the browser to makea select appear there. There is no way but to hide the select item dynamically using DHTML. Z-order will not work at all! Gary Haran
 
I can confirm what xutopia says, you cant do it with layers, the select box is actually a seperate window.

We had this problem with a menu system appearing behind select boxes. The only solution is to set a style of &quot;display:none&quot; on the select box to hide it, and &quot;display:block: to make it visible again. On clicking our menu we hide all select boxes this way. On closing the menu we display them again.

HTH
Cheers

Richard
 
I give a star to rhowes for his insight and giving you an alternative to help you deal with it. I should have given you an alternative as well as telling you z-order couldn't fix it.

Visibility switching can also work the same as display does except doesn't reorganisze the elements on the page as display does. Gary Haran
 
THANKS A LOT TO ALL!!!!!
I was becoming crazy with this problem! mine is also a menu's problem.
I'll give you both a star. I'll have to find an alternative way than hidding all the select objects but i won't break my mind trying to solve the problem with the z-index property...
Again thanks to all!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top