PDA

View Full Version : Tree Menu shows text menu expanded (should be collaped instead by default)



FA1LURE
Jun 15th, 2006, 04:20 AM
My website is www.fa1lure.com and basically if you click on one of the links in the drop down menu... i.e. PAINTINGS... well all the text appropiate to paintins will load in the left frame under the drop down menu.

The problem is after you click on paintings there are sub-sections
(STREET.... FREIGHTS.... GIRLS.... WALLS... RANDOM.... )
in each of those subsections is where the actual text that if you click on them... they load up in the right frame (main frame)

I want my subsections to show up unexpanded so that the user must click it to expand its contents... you know like most tree menus.

I got the code from a friend but neither him nor I know how to fix this problem. I'm very NEW to javascript and have tried a few things. but none of them did a damn thing. haha.

so I would love to post the code here but its pretty lenghty and I would love for someone on here to reaply stating they could help me AFTER viewing my website to know exactly what im talking about.

then I would love ot post the code here. i just dont wanna turn heads away with a bunch of crap. and since I dont know where in the code is where it needs reviewign.. ok well you get the point.

so I ask again. if any of you guys think you can fix this lil problem please help me out.

thanks.

vwphillips
Jun 15th, 2006, 09:14 AM
<html><head><title></title>


<link rel="stylesheet" href="FA1LURE.COM_files/fa1lure.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">

function Collapse(){
var bdy=document.getElementsByTagName('BODY')[0];
var divs=bdy.getElementsByTagName('DIV');
for (var zxc0=0;zxc0<divs.length;zxc0++){
if (divs[zxc0].id){
divs[zxc0].style.display='none';
}
}
}


</script>
</head>
<body bgcolor="#ffffff" text="#000000" onload="Collapse();" >
<script>
var Lst;
function toggleMenu(id) {
if (Lst){ Lst.style.display = "none"; } // you may not want to use this line
try {var e = document.getElementById(id);
if (e == null) return;
if (e.style.display == "none") { e.style.display = "block"; Lst=e; var e = document.getElementById("sign"+id).src = "close.gif"; }
else { e.style.display = "none"; var e = document.getElementById("sign"+id).src = "open.gif";}
}

catch (exception) {}
}

</script>
<div class="menufolder"><a href='javascript:toggleMenu("menu0")'><b>STREET</b></a>
<div id="menu0" class="menuContainer"><a href="http://www.fa1lure.com/paintings/street/palacio.html" target="image">
</a><div class="menufile"><a href="http://www.fa1lure.com/paintings/street/palacio.html" target="image">palacio</a></div>
...............

FA1LURE
Jun 15th, 2006, 08:43 PM
The line you said I might not want to use, I deleted it and the **** is on point
Seriously thank you so much. I more quick question. Do I still need to keep that javascript file I had from before since the code has been changed?

Thanks again.

vwphillips
Jun 15th, 2006, 08:50 PM
Do I still need to keep that javascript file I had from before since the code has been changed?

No

FA1LURE
Jun 16th, 2006, 08:41 AM
Sorry but its def works. but when i added a new section (freights) and load it up it only shows STREET and thn i have to click on street to get to the other sections. let me show you the code. i dunno what im doing wrong?

</script>
<div class="menufolder"><a href='javascript:toggleMenu("menu0")'><b>STREET</b></a>
<div id="menu0" class="menuContainer"><a href="http://www.fa1lure.com/paintings/street/palacio.html" target="image">
</a><div class="menufile"><a href="http://www.fa1lure.com/paintings/street/palacio.html" target="image">palacio</a></div>
<div class="menufile"><a href="http://www.fa1lure.com/paintings/street/burgerking.html" target="image">burger king</a></div>
<div class="menufile"><a href="http://www.fa1lure.com/paintings/street/dadeland.html" target="image">dadeland</a></div>
<div class="menufile"><a href="http://www.fa1lure.com/paintings/street/dadeland.html" target="image">ryder</a></div>
<div class="menufile"><a href="http://www.fa1lure.com/paintings/street/dadeland.html" target="image">house</a></div>
<div class="menufile"><a href="http://www.fa1lure.com/paintings/street/.html" target="image">tracks</a></div>
<div class="menufolder"><a href='javascript:toggleMenu("menu0.1")'><b>FREIGHTS</b></a>
<div id="menu0.1" class="menuContainer"><a href="http://www.fa1lure.com/paintings/street/palacio.html" target="image">
</a><div class="menufile"><a href="http://www.fa1lure.com/paintings/street/palacio.html" target="image">palacio</a></div>
<div class="menufile"><a href="http://www.fa1lure.com/paintings/street/burgerking.html" target="image">burger king</a></div>

vwphillips
Jun 16th, 2006, 09:01 AM
cant see from the limited code you posted but you may not have closed the <DIV> tag

post a link to the actual page with the list.

FA1LURE
Jun 16th, 2006, 09:12 AM
hey you know what.
i just copied the code you wrote in palce of the old code for the main page and its working perfect.

thanks so ****ing much cuhh.