<style type="text/css">
UL {cursor:hand; color:black}
UL UL {display:none; margin-left:5pt}
.hoja{cursor:text; color:navy}
</style>
<script language="JavaScript">
function compruebaParent(ori, dest)
{
while(ori !=null)
{
if(ori.tagName == dest)
return ori;
ori = ori.parentElement;
}
return null;
}
function esquema()
{
var abrir = event.srcElement;
var el = compruebaParent(abrir, "LI");
if (null != el)
{
var pos = 0;
for (pos = 0; pos < el.children.length; pos++)
if ("UL" == el.children[pos].tagName)
break;
if (pos == el.children.length)
return;
}
else
return;
el = el.children[pos];
if ("UL" == el.tagName){
if("" == el.style.display)
el.style.display = "block";
else
el.style.display = "";
}
event.cancelBubble = true;
}
document.onmouseover = esquema;
</script>
</head>
<body>
Este programa muestra como se despliegan los menus y sus submenus.
<p>
<p>
<table bgcolor="#ffffff" width=40%>
<tr><Td>
<UL>
<LI>ELEMENTO 1
<UL>
<LI CLASS="hoja">Subelemento 1
<LI>Subelemento 2
</UL>
<UL>
<LI CLASS="hoja">Subelemento 1
</UL>
</LI>
<LI CLASS="hoja">Elemento 2
</UL>
</td></tr>
</table>
Comentarios sobre la versión: Versión 1 (2)