La Web del Programador: Comunidad de Programadores
https://www.lawebdelprogramador.com/foros/PHP/1209117-Menu-CSS-y-PHP-IE6.html

Menu CSS y PHP (IE6)

Menu CSS y PHP (IE6)

Publicado por jesus (1 intervención) el 10/06/2010 08:36:30
Hola, saludos

El problema: tengo un menu deplegable y este utiliza una hoja de estilos CSS, el mismo se repite ,ediante un bucle while y php, pero, con mozila funciona bien, pero con internet explorer 6 solamente funciona el primer menu que aparece generado por el while. Es decir cuando digo funciona me refiero a que al pasar el puntero del mouse por encima se depliegan los sub menus.

Puede ser algo en el CSS, pienso yo porque si fuera incompatibilidad con IE 6 no deberia ser porque el priemr menu si funciona, los que se repiren no, a continuación les dejo los codigos y mucha gracias.

son tres codigos, el java script, el css y el html

*************************************************** CSS *********************************************


.preload1 {background: url(blank_over.gif);}
.preload2 {background: url(blank_overa.gif);}

#nav {padding:0; margin:0; list-style:none; height:19px; background:#fff; position:relative; z-index:500; font-family:arial, verdana, sans-serif;}
#nav li.top {display:block; float:left;}
#nav li a.top_link {display:block; float:left; height:20px; line-height:19px; color:#666666; text-decoration:none; font-size:11px; font-weight:bold; padding:0 0 0 11px; cursor:pointer;background: url(blank.gif); background-repeat:no-repeat}
#nav li a.top_link span {float:left; display:block; padding:0 25px 0 12px; height:19px;background:url(blank.gif) right top;}
#nav li a.top_link span.down {float:left; display:block; padding:0 25px 0 12px; height:19px; background:url(blanka.gif) no-repeat right top;}
#nav li a.top_link:hover {color:#000000; background: url(blank_over.gif) no-repeat;}
#nav li a.top_link:hover span {background:url(blank_over.gif) no-repeat right top;}
#nav li a.top_link:hover span.down {background:url(blank_overa.gif) no-repeat right top;}

#nav li:hover > a.top_link {color:#000000; text-decoration:underline; background: url(blank_over.gif) no-repeat;}
#nav li:hover > a.top_link span {background:url(blank_over.gif) no-repeat right top;}
#nav li:hover > a.top_link span.down {background:url(blank_overa.gif) no-repeat right top;}

/* Default list styling */

#nav li:hover {position:relative; z-index:200;}

/* keep the 'next' level invisible by placing it off screen. */
#nav ul,
#nav li:hover ul ul,
#nav li:hover ul li:hover ul ul,
#nav li:hover ul li:hover ul li:hover ul ul,
#nav li:hover ul li:hover ul li:hover ul li:hover ul ul
{position:absolute; left:-9999px; top:-9990px; width:0; height:0; margin:0; padding:0; list-style:none}

#nav li:hover ul.sub
{left:0; top:20px; background: #fff; padding:3px; border:1px solid #666666; white-space:nowrap; width:70px; height:auto; z-index:300}
#nav li:hover ul.sub li
{display:block; height:16px; position:relative; float:left; width:60px; font-weight:normal;}
#nav li:hover ul.sub li a
{display:block; font-size:11px; height:16px; width:60px; line-height:20px; text-indent:5px; color:#000; text-decoration:none;}
#nav li ul.sub li a.fly
{background:#fff url(arrow.gif) 60px 7px no-repeat;}
#nav li:hover ul.sub li a:hover
{background:#FFFFFF; color:#000000; text-decoration:underline}
#nav li:hover ul.sub li a.fly:hover
{background:#3a93d2 url(arrow_over.gif) 60px 7px no-repeat; color:#fff;}

#nav li:hover ul li:hover > a.fly {background:#666666 url(arrow_over.gif) 60px 7px no-repeat; color:#fff;}

#nav li:hover ul li:hover ul,
#nav li:hover ul li:hover ul li:hover ul,
#nav li:hover ul li:hover ul li:hover ul li:hover ul,
#nav li:hover ul li:hover ul li:hover ul li:hover ul li:hover ul
{left:90px; top:-4px; background: #fff; padding:3px; border:1px solid #666666; white-space:nowrap; width:60px; z-index:400; height:auto;text-decoration:underline; }



********************************************** HTML *********************************************

<table width="60" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="preload1"></span> <span class="preload2"></span>
<ul id="nav">

<li class="top"><a href="#nogo2" id="products" class="top_link"><span class="down">Acción</span></a>
<ul class="sub">
<li><a href="#nogo3" >Modificar</a></li>
<li ><a href="#nogo7" >Eliminar</a></li>
<li><a href="#nogo19">Pausar</a></li>
<li><a href="#nogo20">Re-activar</a></li>
</ul>
</li>
</ul>
</li></td>
</tr>
</table>



****************************************** JAVASCRIPT (parece que no lo usa) ******************
stuHover = function() {
var cssRule;
var newSelector;
for (var i = 0; i < document.styleSheets.length; i++)
for (var x = 0; x < document.styleSheets[i].rules.length ; x++)
{
cssRule = document.styleSheets[i].rules[x];
if (cssRule.selectorText.indexOf("LI:hover") != -1)
{
newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);
}
}
var getElm = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<getElm.length; i++) {
getElm[i].onmouseover=function() {
this.className+=" iehover";
}
getElm[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" iehover\\b"), "");
}
}
}
if (window.attachEvent) window.attachEvent("onload", stuHover);



SALUDOS Y MUCHAS GRACIAS