?
Solved

HTML+Javascript tree menu

Posted on 2002-03-21
10
Medium Priority
?
179 Views
Last Modified: 2010-04-09
I am trying to make a one level tree menu with the help of a simple java script function and html.
I am using this html as my frist and second level of menu.

<ul id="foldheader">
Testing menu
</ul>
<ul id="foldinglist" style="display:none">
second level
</ul>

to hide/display all i do is call this function [in IE] and this works in IE.

if (event.srcElement.id=="foldheader") {

var srcIndex = event.srcElement.sourceIndex
var nested = document.all[srcIndex+1]
if (nested.style.display=="none")
{
 nested.style.display=''
}
else
{
 nested.style.display="none"
}
}
I am unable to catch the event in netscape. Any idea/solution how to toggle the <ul id="foldinglist"
style="display:none"> to display="visible" for *NETSCAPE*. This is very urgent for me.As is visible
from the question points that i am awarding.

0
Comment
Question by:qudoos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 12

Expert Comment

by:lexxwern
ID: 6887642
<ul id="foldinglist" style="display:none">

try the semicolon

<ul id="foldinglist" style="display:none;">

lhn
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 6887646
and which version of netscape are you refering to?
0
 
LVL 19

Accepted Solution

by:
DreamMaster earned 1200 total points
ID: 6888056
qudoos, Unordered lists do not have events in Netscape...you will have to use a DIV or a layer for that...

Max.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:qudoos
ID: 6888624
well, yeah i think i figured this one out that they dont have events. But what if i say "document.onclick" and call my function, i may still be able to change the status of the unordered list? right? all i need is to change the status from none to visible.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6888710
I'm pretty sure that it won't work...

If you want the same effect in Netscape you just need layers...correct me if I'm wrong anyone...

Max.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6888914
An event on the document is of no use to you because Netscrap is still not going to know what element was clicked.  

You have to use layers.

BTW, even with layers you probably still have a problem in Netscrape.  Changing the display attribute reuires re-rendering.  Netscrap generally will not do that without a reload of the page if eleemnts have to be repossitioned.  If there are any form elements on the page that have to be re rendered, Netscrap will either crash or ignore the function.

For dynamic disply in Netscrap you are going to have to use visibility modification on the layeres if you want to have any hope of actually getting Netscrap to give you some reasonable rendition of the effect

Cd&
0
 
LVL 1

Author Comment

by:qudoos
ID: 6889063
LOL!!!

well, i got the point...and i can see that NETSCRAP is still not going to know what element was clicked.well said!
   
anyways, I just didnt want to do it with layers. I dont have much time to make the layers move up and down.Thanks though!
but since it is the same answer, i will award the points to DreamMaster who is trying to tell me the same thing over and over again.

Thanks!
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6890228
If you want to have a look at an example....take a look at:

http://www.vodw.com/

In the left menu appear two drop downs...either one will do...select an option from that menu and another menu will load there...that menu has layers that go up and down..the code is actually not that hard...and if you have problems...I can help you.. :)

Thanks allready for wanting to award me the points.. :)

Max.
0
 
LVL 1

Author Comment

by:qudoos
ID: 6894467
I have been busy with the layers, so sorry for being late to give u the numbers!

thanks!
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6894728
No worries...if you would have waited an other couple of days it would have been even better...I would have the first 1200 points for april.. :) Just kiddin...thanks for the Grade A.. :)

Max.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question