Re: menu al estilo outlook porfin quedo namas hay que optimizar el codigo
<!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=utf-8" />
<link href="Css/menu.css" rel="stylesheet" type="text/css" />
<link href="Css/dtree.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function maximo()
{
//alert("mensaje ejecutado desde el frame menu");
adaptarAlto();
}
</script>
<title>Documento sin título</title>
</head>
<body >
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" background="../Imagen/inter_menu_bg.jpg">
<table width="191"border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div id="contenedor_menu">
<div id="AccordionContainer" class="AccordionContainer">
<div onclick="expander(1)">
<div class="AccordionTitle">
Accordion 1
</div>
</div>
<div id="Accordion1Content" class="AccordionContent">
<table border="0">
<tr>
<td>
<script type="text/javascript">
dd = new dTree('dd');
dd.add(0,-1,'Procesos');
dd.add(17,0,'Node 17','example01.html');
dd.add(18,0,'Node 18','example01.html');
dd.add(19,0,'Node 19','example01.html');
dd.add(20,0,'Node 20','example01.html');
dd.add(21,0,'Node 21','example01.html');
dd.add(22,0,'Node 22','example01.html');
dd.add(23,0,'Node 23','example01.html');
dd.add(24,0,'Node 24','example01.html');
dd.add(25,17,'Node 25','example01.html');
document.write(dd);
</script>
</td>
</tr>
</table>
</div>
<div onclick="expander(2)">
<div class="AccordionTitle">
Accordion 2
</div>
</div>
<div id="Accordion2Content" class="AccordionContent">
<table width="400" id="tabla_arbol" border="0">
<tr>
<td>
<script type="text/javascript">
d = new dTree('d');
d.add(0,-1,'Catalagos');
d.add(1,0,'Node 1','example01.html');
d.add(2,0,'Node 2','example01.html');
d.add(3,1,'Node 1.1','example01.html');
d.add(4,0,'Node 3','example01.html');
d.add(5,3,'Node 1.1.1','example01.html');
d.add(6,5,'Node 1.1.1.1','example01.html');
d.add(7,0,'Node 4','example01.html');
d.add(8,1,'Node 1.2','example01.html');
d.add(9,0,'My Pictures','example01.html','Pictures I\'ve taken over the years','','','../Imagen/Tree_img/imgfolder.gif');
d.add(10,9,'The trip to Iceland','example01.html','Pictures of Gullfoss and Geysir');
d.add(11,9,'Mom\'s birthday','example01.html');
d.add(12,0,'Node 1.2 Bin','example01.html','','','img/trash.gif');
d.add(13,5,'Node 1.2 Bin1','example01.html');
d.add(14,5,'Node 1.2 Bin2','example01.html');
d.add(15,14,'Node 1.2 Bin2','example01.html');
d.add(16,15,'Node 1.2 Bin2','example01.html');
document.write(d);
</script>
</td>
</tr>
<tr>
<td>
<script type="text/javascript">
ddd = new dTree('ddd');
ddd.add(0,-1,'Consultas');
ddd.add(17,0,'0009','example01.html');
ddd.add(18,17,'00010','example01.html');
ddd.add(19,18,'00020','example01.html');
ddd.add(20,19,'00030','example01.html');
ddd.add(21,0,'00040','example01.html');
ddd.add(22,0,'00050','example01.html');
ddd.add(23,17,'00060','example01.html');
document.write(ddd);
</script>
</td>
</tr>
</table>
</div>
<div onclick="expander(3);">
<div class="AccordionTitle" onselectstart="return false;">
Accordion 3
</div>
</div>
<div id="Accordion3Content" class="AccordionContent">
<table width="400" border="1">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
<div onclick="expander(4);">
<div class="AccordionTitle" onselectstart="return false;">
Accordion 4
</div>
</div>
<div id="Accordion4Content" class="AccordionContent">
I Am Accordion 4.
</div>
<div onclick="expander(5);">
<div class="AccordionTitle" onselectstart="return false;">
Accordion 5
</div>
</div>
<div id="Accordion5Content" class="AccordionContent">
I Am Accordion 5.
</div>
</div>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script language="javascript">
window.onload = verificarAlto;
var largamiento;
var anterior_modulo;
function verificarAlto()
{
var altoframe=parent.document.getElementById('frmenu') .offsetHeight;
//alert("el frame mide:"+altoframe);
var altocontenedor=document.getElementById('AccordionC ontainer').offsetHeight;
//alert("el contenedor del menu mide:"+altocontenedor);
largamiento=altoframe-altocontenedor;
document.getElementById('contenedor_menu').style.h eight=altoframe+"px";
}
function adaptarAlto()
{
//alert("adaptando");
var nwaltoframe=parent.document.getElementById('frmenu ').offsetHeight;
//alert("el frame mide ahora:"+nwaltoframe);
if(anterior_modulo!=null)
{
document.getElementById(anterior_modulo).style.hei ght=0+"px";
var nwaltocontenedor=document.getElementById('Accordio nContainer').offsetHeight;
//alert("el contenedor ahora mide: "+nwaltocontenedor);
largamiento=0;
var nwlarge=nwaltoframe-nwaltocontenedor;
largamiento=nwlarge;
//alert(nwlarge);
document.getElementById(anterior_modulo).style.hei ght=nwlarge+"px";
}
else
{
//document.getElementById(anterior_modulo).style.hei ght=0+"px";
largamiento=0;
var nwaltocontenedor=document.getElementById('Accordio nContainer').offsetHeight;
var nwlarge=nwaltoframe-nwaltocontenedor;
largamiento=nwlarge;
//alert(nwlarge);
//document.getElementById(anterior_modulo).style.hei ght=nwlarge+"px";
}
}
function expander(indice_modulo)
{
//alert("largo es:"+largamiento);
var idmodulo = "Accordion" + indice_modulo + "Content";
//alert(idmodulo);
if(anterior_modulo!=null)
{
document.getElementById(anterior_modulo).style.hei ght=0+"px";
document.getElementById(anterior_modulo).style.dis play='none';
//alert("anterior es:"+anterior_modulo);
}
if(idmodulo!=anterior_modulo)
{
//alert(largamiento);
document.getElementById(idmodulo).style.height=lar gamiento+"px";
document.getElementById(idmodulo).style.display='b lock';
anterior_modulo=idmodulo;
}
else
{
anterior_modulo=null;
}
}
</script>
</body>
</html>
__________________ gerardo
Última edición por chalchis; 13/12/2007 a las 15:21 |