Click to See Complete Forum and Search --> : Please ! Help needed for tree menu
Motabobo
06-02-2003, 12:33 PM
Hi !
I have some problems implementing a ASP generated tree menu. My problem is javascript related though.
A picture is worth a thousand words so you can take a look at my problem here :
http://pages.infinit.net/rouxjean/bug.gif
Here is the link to my test page (it may take some time to load - please be patient !) :
http://www21.brinkster.com/rouxjean/explorer/tree/index.htm
Thank you !
I really need this script to work with Netscape !
scriptkid
06-02-2003, 01:39 PM
source code is way to messy to tell whats going on in that thing...
you should add some vbNewLine to the output so the code is cleaner
or i can whip up an asp/javascript tree control if u give me a few seconds to code it.
Khalid Ali
06-02-2003, 01:50 PM
I remember what happened...I tried toget the css file used for this and I could not....so I stopped working on it..:D
Motabobo
06-02-2003, 01:59 PM
scriptkid: i originally put vbnewline but for some reason it added spaces between the tree menu images !
Khalid Ali: i've attached the css with this post !
rename the style15.txt for style15.css :p
Tell me if you guys want me to add vbnewline and/or add the js file and/or the menu.asp !
scriptkid
06-02-2003, 02:04 PM
id like u to add the menu.asp thingy so i can get it to format the output correctly :)
maybe i can add some efficiency to it too never know ;)
Khalid Ali
06-02-2003, 02:17 PM
Hey roux...
replace your swapImage functionin the JS file with the one below
function swapTree(menuDiv,fol){
window.focus();
d = document.getElementById(menuDiv);
i = document.images["img_"+menuDiv];
i1 = document.images["img_"+fol];
if (d.style.display=="none"){
d.style.display="block";
i.src='../img/minus.gif';
} else{
d.style.display="none";
i.src='../img/plus.gif';
i1.src='../img/folder.gif';
}
}
An your menu is good to go...( for the problem you mentioned)...
But believe me its not a very healthy coding...:D
Motabobo
06-02-2003, 02:22 PM
Here is the complete source with the images.
If you have time (talking about adding some efficiency :p ), i'd like to get the folder's files in the right frame (instead of below the folder) when i click on one(nevermind about presentation, i will fix that i just want the data to appear there correctly lol).
Motabobo
06-02-2003, 02:36 PM
Khalid Ali: i can't test your script right now ! I'm at work and i don't have IIS installed, but shhh don't tell him i'm here passing time :D
But trust me i will when i get home lol
I'm just curious why you said it was no healthy coding ;)
Motabobo
06-02-2003, 02:43 PM
I'm still interested in what you can come up with scriptkid ;)
diamonds
06-02-2003, 02:51 PM
really nice menu, by the way ;)
Have you thought of using js ENTIRELY for the menu, not using div's?
I saw one here (http://www.treeview.net/). just take a look at the source code
also, the images are spaced. there are blank spots for some reason.
there is a gap of 3 pixels vertical, and 2 horizontal
diamonds
06-02-2003, 02:53 PM
I just realised, it looks like you have that problem in netscape. but i have IE.
scriptkid
06-02-2003, 03:05 PM
im working on something completely new cause i didnt like how that asp script was put together :-/
Ill post it tomorrow
Motabobo
06-02-2003, 03:10 PM
I think i know why there is spaces, it's because there is a carriage return in the source between the img tag ie:
<img ...
<img ...
instead of
<img>...</img><img>.....</img>
But i am not sure though i will have to test it first lol
As for the other menu, i'm not sure how to do it since i have to go trough all the directories structure in a single loop and so, have to write the menu at once.
Maybe there is some other way, so i could use, for example, the "standard" tree menu version available at dynamicdrive :
http://www.dynamicdrive.com/dynamicindex1/navigate1.htm
I don't know how i could implement this :(
By the way guys, i'm also looking for a script that could save th tree menu status in a cookie (again for both NN & IE).
Thanks
Motabobo
06-02-2003, 03:11 PM
Scriptkid: you're the man ! (or kid ?!?!)
Anyway, i can't wait to see it !!! I found that my previous script was a bit slow....:D
scriptkid
06-02-2003, 03:18 PM
Well i suppose im a man now (19 living on own) but I still act like a kid from time to time ;)
I didn't like how long it took to load either, and I have no idea why they made their own Replace function...but anyways. I'll post what I come up with tomorrow. I'm still at work myself and supposed to be working on a site for someone :-/
Motabobo
06-02-2003, 04:03 PM
Just for your information Khalid Ali, the javascript you provided is still a bit buggy.
The bug i illustrated in my image at a previous post concerning the closing action on the tree menu is still there under Netscape.
You only removed the open bug.