473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Tree menu

I try to build a tree menu.

The idea is that the submenu is in a hidden absolute position table. By
clicking the folder.gif, the submenu table switces to visible - static,
so opens.
This helps me to put the tree anywhere in a page, and not in x,y position.

It works fine in IE but not in Netscape or Firefox.

Can someone please help me to fix ??

Here is the code :
<html>
<head>
</head>

<script language=javascript>

function viewsub(){
if (view.type == "off"){
view.type="on";
view.style.visibility="visible";
view.style.position="static";
} else {
view.type="off";
view.style.visibility="hidden";
view.style.position="absolute";
}

}

</script>

<body>
<table cellpadding=1 cellspacing=0 border=1>
<td><img src=folder.gif onclick=viewsub()>Open folder

<table border=0 cellpadding=1 cellspacing=0 id="view" type=off
width=95% style="visibility: hidden; position:absolute; left: 0; top: 0">
<td>Sub link</td>
</table>

</td></table>

</body>
</html>

May 31 '06 #1
1 1384
vagos wrote:
[...]
It works fine in IE but not in Netscape or Firefox.

Can someone please help me to fix ??

Here is the code :
<html>
<head>
</head>

<script language=javascript>

function viewsub(){
if (view.type == "off"){
view.type="on";
view.style.visibility="visible";
view.style.position="static";
} else {
view.type="off";
Again, host objects should not be used as data containers
if this required the augmentation with new properties.

It is not necessary here anyway, one can test against the
value of the `visibility' or `display' property instead.
view.style.visibility="hidden";
view.style.position="absolute";
Use `display' instead of `visibility' and `position'.
}

}

</script>

<body>
<table cellpadding=1 cellspacing=0 border=1>
<td><img src=folder.gif onclick=viewsub()>Open folder

<table border=0 cellpadding=1 cellspacing=0 id="view" type=off
width=95% style="visibility: hidden; position:absolute; left: 0; top: 0">
<td>Sub link</td>
</table>

</td></table>

</body>
</html>


<URL:http://validator.w3.org/>
<URL:http://jigsaw.w3.org/css-validator/>

And don't use tables; use lists.

A tree made out of a list:
<URL:http://javascripttoolbox.com/lib/mktree/>

A tree with dynamically created branches:
<URL:http://pointedears.de/ObjectInspector>
(look into the showProperties() method in objinsp.js;
a TreeView library based on this is under construction)
PointedEars
May 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jo | last post by:
I don't know if this can be done.. But here is what i am trying to do... I have a tree menu on a frameless page. I have the menu on the right hand side and a CGI web form post on the left....
7
by: johkar | last post by:
I am confused on childNodes or children. When you have nested lists, I would think it would all be one list in the Dom, this doesn't seem to be the case. So how do you traverse an unordered list?...
4
by: Sergio Millich | last post by:
I have an annoyîng problem with a javascript tree. When you scroll down to the bottom of the tree and click to open a node the tree is refreshed and scrolls back to the top, hiding the node. Is...
0
by: Tree menu using XML | last post by:
I have one XML file that has nodes and sub node and each and every node has the attribute call visible if its value is true then diplay this node else don't display thid node, but this condition i...
4
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working,...
1
by: Jesper DK | last post by:
Hi, I have docked a tree view to the left on a form. When I start to populate this tree view with nodes, a horizontal scroll box appears in the bottom of the tree view even though thee tree...
1
by: w.p. | last post by:
Hello! I have some trouble with my GUI. I have left panel with foldpanelbar, but i need one item but not collapsed - simple button. I split my left panel into two foldpanelbars with one button...
6
by: Travis | last post by:
Is there a community accepted best way to store a menu tree for an interface in a data structure. Ideally I would like something that searches fast so given a menu structure like this File / ...
3
by: Travis | last post by:
I've created a custom Tree template. The tree mimics a menu tree and has the following properties. - nodes are identified by a unique name - any node can have infinite child nodes - nodes are not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.