Solved

HTML+Javascript tree menu

Posted on 2002-03-21
10
176 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 300 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
align Linkedin sign to the right page 5 55
Change Background Color of Website 5 29
Html test in IIS 4 23
removing a class in javascript 4 51
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
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 …

821 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