473,587 Members | 2,509 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=javasc ript>

function viewsub(){
if (view.type == "off"){
view.type="on";
view.style.visi bility="visible ";
view.style.posi tion="static";
} else {
view.type="off" ;
view.style.visi bility="hidden" ;
view.style.posi tion="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="visibili ty: hidden; position:absolu te; left: 0; top: 0">
<td>Sub link</td>
</table>

</td></table>

</body>
</html>

May 31 '06 #1
1 1391
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=javasc ript>

function viewsub(){
if (view.type == "off"){
view.type="on";
view.style.visi bility="visible ";
view.style.posi tion="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.visi bility="hidden" ;
view.style.posi tion="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="visibili ty: hidden; position:absolu te; left: 0; top: 0">
<td>Sub link</td>
</table>

</td></table>

</body>
</html>


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

And don't use tables; use lists.

A tree made out of a list:
<URL:http://javascripttoolb ox.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
5838
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. When i Post a form and it displays a new html page i would like to see a different branch expaned on the tree menu and close (who be a bonus) the other one that is open.
7
2979
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? Any help appreciated. John In the below script, I can expand and contract the nodes when clicked on, but I want the menu to close all other siblings to the node clicked so that only one sub menu option is expanded at one time. If the node...
4
2081
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 there a way to prevent the page from being scrolled back to the top on every refresh? Thank you for your help.
0
2164
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 am able to check using xpath in asp.net 2.0 till MenuItem node. if i check visible attribute value till SubMenuLevel0 node then in tree it will not display the MenuItem Node at all Note: My tree Menu will start from MenuItem node and it will...
4
9011
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, even the removal, I just don't know how to keep track of the parent, so that I can set its child to the child of the node to be removed. IE - if I had C / \ B D
1
4901
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 view is big largely big enough to fit the nodes and text. If I widen the tree view the scroll bar doesn't resize itself to show the relative view size in relation to the total size. Only if I narrow the view to not fit the nodes, the scroll box...
1
2302
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 between. But a have trouble... Sorry for english :/ Simple code:
6
6144
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 / | \ / | \ Print Exit Edit / \ Copy Paste
3
3214
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 sorted so traversal is breadth first looking for the key - nodes are inserted by identifying the desired parent This works out well once the tree is constructed because it actually resembles the menu tree but as with a lot of things in...
1
7974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1192
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.