Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

HTML+Javascript tree menu

Posted on 2002-03-21
10
Medium Priority
?
180 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
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

971 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