Foros del Web » Programando para Internet » Javascript »

Menú de árbol... (trees)

Estas en el tema de Menú de árbol... (trees) en el foro de Javascript en Foros del Web. Holas!!! Andaba buscando un menú de Arbol y como no encontraba me dijieron que pregunte acá que seguramente me iban a ayudar... Sin propaganda si ...
  #1 (permalink)  
Antiguo 09/08/2003, 18:20
 
Fecha de Ingreso: agosto-2003
Ubicación: Rosario
Mensajes: 7
Antigüedad: 20 años, 8 meses
Puntos: 0
Menú de árbol... (trees)

Holas!!!
Andaba buscando un menú de Arbol y como no encontraba me dijieron que pregunte acá que seguramente me iban a ayudar... Sin propaganda si es posible... Sé sobre PHP pero nada de Js... Capaz saben como crearlo y me pueden dar una mano o sino darme un .Js a modificar...

Gracias a todos por la buena onda ;)

Saludos!
  #2 (permalink)  
Antiguo 22/08/2003, 16:40
 
Fecha de Ingreso: agosto-2003
Mensajes: 4
Antigüedad: 20 años, 8 meses
Puntos: 0
Aqui va tu Menú

Prueba esto espero te ayude a tu proposito.
La primera parte va entre la etiquetas head y la segunda en body en medio del script veras que te lo dice.

<!--->
<link rel=stylesheet href=./index.css type=text/css>
<script language=JavaScript>
<!--
content = new Array ();

content [0] = new Array (
false,
new Array('sub_0_1','sub_0_2','sub_0_3')
);
content [1] = new Array (
false,
new Array('sub_1_1','sub_1_2','sub_1_3')
);
content [2] = new Array (
false,
new Array('sub_2_1','sub_2_2','sub_2_3')
);

isOPERA = (navigator.userAgent.indexOf('Opera') >= 0)? true : false;
isIE = (document.all && !isOPERA)? true : false;
isDOM = (document.getElementById && !isIE && !isOPERA)? true : false;

function processTree (id)
{
if (content [id][0])
{
for (i = 0; i < content [id][1].length; i++)
hide (content [id][1][i]);

content [id][0] = false;
}
else
{
for (i = 0; i < content [id][1].length; i++)
show (content [id][1][i], 'table-row');

content [id][0] = true;
}

return false;
}

function show (id, displayValue)
{
if (isDOM)
document.getElementById(id).style.display = (displayValue)? displayValue : "block";
else if (isIE)
document.all[id].style.display = "block";
}

function hide (id)
{
if (isDOM)
document.getElementById(id).style.display = "none";
else if (isIE)
document.all[id].style.display = "none";
}
if (isDOM || isIE)
{
document.writeln('<style type="text/css">');
document.writeln('.SubItemRow \{ display: none; \}');
document.writeln('</style>');
}

// -->
</script>
<!--Pegar el codigo de arriba en el head tags-->
<!--pegar el codigo siguiente en el body tags-->
<table width=150 height=40 border=0 cellpadding=0 cellspacing=1>
<tr>
<td width=1 class=Item>+</td>
<td width=149 height=20 class=Item><a href=./ class=Item onClick="processTree (0); return false;">Luego lo modificas a tu gusto o añades mas links</a></td>
</tr>
<tr id='sub_0_1' class=SubItemRow>
<td width=10>&nbsp;</td>
<td width=149 height=20 class=SubItem><a href="http://www.loquesea">titulo1</a></td>
</tr>
<tr id='sub_0_2' class=SubItemRow>
<td width=10>&nbsp;</td>
<td width=149 height=20 class=SubItem><a href="http://www.loquesea">titulo2</a></td>
</tr>
<tr id='sub_0_3' class=SubItemRow>
<td width=10>&nbsp;</td>
<td width=149 height=20 class=SubItem><a href="http://www.loquesea">titulo3</a></td>
</tr>
<tr>
<td width=1 class=Item>+</td>
<td width=149 height=20 class=Item><a href=./ class=Item onClick="processTree (1); return false;">modifica colores etc...</a></td>
</tr>
<tr id='sub_1_1' class=SubItemRow>
<td width=10>&nbsp;</td>
<td width=149 height=20 class=SubItem><a href="http://www.loquesea">titulo1</a></td>
</tr>
<tr id='sub_1_2' class=SubItemRow>
<td width=10>&nbsp;</td>
<td width=149 height=20 class=SubItem><a href="http://www.loquesea">titulo2</a></td>
</tr>
<tr id='sub_1_3' class=SubItemRow>
<td width=10>&nbsp;</td>
<td width=149 height=20 class=SubItem><a href="http://www.loquesea">titulo3</a></td>
</tr>
<tr>
<td width=1 class=Item>+</td>
<td width=149 height=20 class=Item><a href=./ class=Item onClick="processTree (2); return false;">Espero sea lo que buscas</a></td>
</tr>
<tr id='sub_2_1' class=SubItemRow>
<td width=10>&nbsp;</td>
<td width=149 height=20 class=SubItem><a href="http://www.loquesea">titulo1</a></td>
</tr>
<tr id='sub_2_2' class=SubItemRow>
<td width=10>&nbsp;</td>
<td width=149 height=20 class=SubItem><a href="http://www.loquesea">titulo2</a></td>
</tr>
<tr id='sub_2_3' class=SubItemRow>
<td width=10>&nbsp;</td>
<td width=149 height=20 class=SubItem><a href="http://www.loquesea">titulo3</a></td>
</tr>
</table>
  #3 (permalink)  
Antiguo 22/08/2003, 16:42
 
Fecha de Ingreso: agosto-2003
Ubicación: Rosario
Mensajes: 7
Antigüedad: 20 años, 8 meses
Puntos: 0
Xerach, muchísimas gracias... apenas tenga tiempo lo cheko y les comento... gracias!!! :D
  #4 (permalink)  
Antiguo 31/08/2003, 05:23
 
Fecha de Ingreso: agosto-2003
Mensajes: 4
Antigüedad: 20 años, 8 meses
Puntos: 0
Bueno echale un vistazo ya ves que es modificable espero sea mas o menos lo que buscabas.

Última edición por Xerach; 31/08/2003 a las 05:26
  #5 (permalink)  
Antiguo 31/08/2003, 06:39
 
Fecha de Ingreso: agosto-2003
Ubicación: Rosario
Mensajes: 7
Antigüedad: 20 años, 8 meses
Puntos: 0
Sip es lo que buscaba!...


Muchas gracias...
  #6 (permalink)  
Antiguo 01/09/2003, 00:56
Avatar de nuevo  
Fecha de Ingreso: mayo-2003
Ubicación: Spain
Mensajes: 2.009
Antigüedad: 21 años
Puntos: 2
yeee, que pasada tiosssss, gracisa amigo... menudo script...
__________________
3w.valenciadjs.com
3w.laislatv.com
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 05:02.