Solved

HTML+Javascript tree menu

Posted on 2002-03-21
10
173 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
Comment Utility
<ul id="foldinglist" style="display:none">

try the semicolon

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

lhn
0
 
LVL 12

Expert Comment

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

Accepted Solution

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

Max.
0
 
LVL 1

Author Comment

by:qudoos
Comment Utility
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
Comment Utility
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now