Foros del Web » Programando para Internet » Javascript »

javascript en Menu

Estas en el tema de javascript en Menu en el foro de Javascript en Foros del Web. Estoy intentado hacer un menu como se ve en el sitio: http://www.alistapart.com/articles/horizdropdowns/ Segui todas la instrucciones, pero al incorporar el archivo javascript no me funciona ...
  #1 (permalink)  
Antiguo 25/03/2005, 16:20
 
Fecha de Ingreso: septiembre-2003
Ubicación: Buenos Aires, Argentina
Mensajes: 92
Antigüedad: 20 años, 7 meses
Puntos: 1
javascript en Menu

Estoy intentado hacer un menu como se ve en el sitio: http://www.alistapart.com/articles/horizdropdowns/

Segui todas la instrucciones, pero al incorporar el archivo javascript no me funciona correctamente. ¿ debo hacer un archivo externo y linkearlo ? o ¿ debe estar dentro del documento html ? Si hay que linkearlo, ¿ pueden decirme como hacerlo con Dreamweaver ?

Hasta ahora lo que tengo es:

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Menu</title>
<link href="estilomenu.css" rel="stylesheet" type="text/css" />
</head>
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">Conozcanos</a></li>
<li><a href="#">Hierros</a></li>
<li><a href="#">Tubos Estructurales</a></li>
<li><a href="#">Chapas</a></li>
<li><a href="#">Metal Desplegado</a></li>
<ul>
<li><a href="#">Escalones</a></li>
<li><a href="#">Alcantarillas</a></li>
<li><a href="#">Chapas Perforadas</a></li>
</ul>
<li><a href="#">Herreria Artisitica</a></li>
<li><a href="#">Mallas</a></li>
<li><a href="#">Herramientas Electricas</a></li>
<ul>
<li><a href="#">Makita</a></li>
<li><a href="#">Metabo</a></li>
<li><a href="#">Intraud</a></li>
</ul>
<li><a href="#">Pesos y Medidas</a></li>
<li><a href="#">Ofertas del Mes</a></li>
<li><a href="#">Novedades</a></li>
<li><a href="#">Links</a></li>
<li><a href="#">Solicite Presupuesto</a></li>
<li><a href="#">Formas de Pago</a></li>
<li><a href="#">¿Donde estamos?</a></li>
</ul>
<body>
</body>
</html>


Y el archivo javascript que figura en ese sitio para los efectos es:

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace»
(" over", "");
}
}
}
}
}
window.onload=startList;
  #2 (permalink)  
Antiguo 25/03/2005, 16:35
 
Fecha de Ingreso: septiembre-2003
Ubicación: Buenos Aires, Argentina
Mensajes: 92
Antigüedad: 20 años, 7 meses
Puntos: 1
dejo la url para que vean como esta hasta ahora: http://www.hierrostorrent.com.ar/Menu/Men.htm

cuando hago el preview con Dreamweaver me funciona mal, subido en internet no me funciona del todo.

El archivo css es:
/* CSS Document */

ul {
margin: 0;
padding: 0;
list-style: none;
width: 150px;
border-bottom: 1px solid #ccc;
}
ul li {
position: relative;
}
li ul {
position: absolute;
left: 149px;
top: 0;
display: none;
}
ul li a {
display: block;
text-decoration: none;
color: #777;
background: #fff;
padding: 5px;
border: 1px solid #ccc;
border-bottom: 0;
}
li:hover ul, li.over ul {
display: block; }

/* Fix IE. Hide from IE Mac \*/
* html ul li { float: left; }
* html ul li a { height: 1%; }
/* End */
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:41.