Solved

HTML+Javascript tree menu

Posted on 2002-03-21
10
178 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 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
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 position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
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 …

617 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