Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:25

Trouble still embedding treemenu...


Poster: ripnoel
Dated: Wednesday December 5 2007 - 22:08:30 GMT

Well I guess I'm for sure having one of those days too!

Having trouble embedding this tree menu...

Here is what I have placed in my table cell:

<SCRIPT TYPE="text/javascript">
with(new menuname("main Tree Menu")){
top=0
left=0
style = tstyle1;
alwaysvisible = 1;
itemwidth=175
//margin=AllMargin
position="relative"
aI("text=MILONIC;");
aI("text=Home;");
aI("text=News;showmenu=News;type=tree;image=blue_blip.gif;overimage=red_blip.gif");
aI("text=Finance;showmenu=Finance;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Sports;showmenu=Sports;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Entertainment;showmenu=Entertainment;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Music;showmenu=Music;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Games;");
aI("text=Relationships;");
aI("text=Travel;");
aI("text=Shopping;");
}
</SCRIPT>

Commented out the same in the collapse_data.js file. Now the treemenu has disappeared..

Help appreciated.

BTW, once I get this working I do want to place the embeded part in a seperate file to keep from having to edit lots of pages when a change is needed.

Rip

Re: Trouble still embedding treemenu...


Poster: Ruth
Dated: Wednesday December 5 2007 - 22:18:30 GMT

Hi,

Can you give me a link to the page, that way I can see what's going on, there's no way to tell just from the post of the main menu.

Ruth

Re: Trouble still embedding treemenu...


Poster: ripnoel
Dated: Wednesday December 5 2007 - 22:25:24 GMT

http://www.abacusarts.com/fst/index.html

javascript is in http://www.abacusarts.com/fst/js

Rip

Re: Trouble still embedding treemenu...


Poster: Ruth
Dated: Wednesday December 5 2007 - 23:13:46 GMT

Hi,

OK, the reason it's not showing is you need a drawmenus(); at the end of the main menu. BUT, don't do it that way, when I tried it setting up the relatively positioned menu using that old method, the submenus wouldn't open. I don't know why, I think it has something to do with how the treemenu functions and the fact that the file is being split so the submenus get built first. But, anyway, you need to use the new method for positioning it relatively.

Put the main menu back in the data file

Code:
with(new menuname("main Tree Menu")){
style = tstyle1;
alwaysvisible = 1;
itemwidth=200
//margin=AllMargin
position="relative"
aI("text=MILONIC;");
aI("text=Home;");
aI("text=News;showmenu=News;type=tree;image=blue_blip.gif;overimage=red_blip.gif");
aI("text=Finance;showmenu=Finance;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Sports;showmenu=Sports;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Entertainment;showmenu=Entertainment;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Music;showmenu=Music;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Games;");
aI("text=Relationships;");
aI("text=Travel;");
aI("text=Shopping;");
}


Then at the top right under the subOffsetLeft=0; add buildAfterLoad=true;

Save the file. Then on your page, where you now have the main menu in the script tags, instead call all the files there

Code:
<TR>
                      <TD vAlign=top align=left>
                     <SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>

<SCRIPT language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>"); </SCRIPT>

<SCRIPT language=JavaScript src="collapse_data.js"
type=text/javascript></SCRIPT>

<SCRIPT language=JavaScript src="treemenu.js"
type=text/javascript></SCRIPT>
                      </TD>


Hope this helps.

Ruth

Re: Trouble still embedding treemenu...


Poster: ripnoel
Dated: Thursday December 6 2007 - 0:16:42 GMT

Yep... that did it. Working now.

Thanks again,

Rip

Re: Trouble still embedding treemenu...


Poster: Ruth
Dated: Thursday December 6 2007 - 0:35:34 GMT

Just for your information, I notice this is a University site, so, if you need something like being able to have a menu if js is turned off for accessibility you can also create this treemenu setup using the Milonic listmenu, it will create whatever the style you have set up from a list menu i.e. ul/li etc. It takes a bit more to set up, but once done seems to work just fine. If you want to try that, let me know.

Ruth

Re: Trouble still embedding treemenu...


Poster: nwilcox
Dated: Wednesday February 13 2008 - 20:03:01 GMT

How would you create a treemenu wiht the listmenu setup? I'm trying this right now :?:

Thanks!

Re: Trouble still embedding treemenu...


Poster: Ruth
Dated: Thursday February 14 2008 - 7:00:47 GMT

Hiya,

Give me a day and I'll send you a setup of one I did for John. It is much easier than trying to explain, but I need to find it. I know I've got it because I kept it for examples, just not sure what folder :oops: It's on the old computer, duh. OK, I'll post it here tomorrow for you.

Ruth

Re: Trouble still embedding treemenu...


Poster: Ruth
Dated: Thursday February 14 2008 - 13:37:50 GMT

Hi,

Well, I found it, but I think it is easier to give you the setup using the listmenu example in the menu download.

1. go to the extras/listbased_menu folder in the menu download and open the index.html page and save it under some other name [now you'll have the original listbased page if y ou need it.
2. download and save the treemenu.js file to that listbased extras folder.
3. add the following things to the information on the page in the script tags that appear after the ul menus. The top 3 go right after the _subOffsetLeft=-2, and before the menuStyle section, and the other items I go into the menuStyle section to set a width and the type of menu it is

Code:
AllMargin=0;
treeOffset=0;
singleMasterMenu=true;

itemwidth=240;
type="tree";


I didn't add anything like the clicksubimage, onsubimage, clickcolor, or clickbgcolor, or clickbgimage if you're using any of those. But they can be added to the style. Just remember that since you are doing a 'listbased' menu and don't have a file with the aI strings, you cannot add things to each 'item' to make changes to it, like different image for items, etc.

I will be glad to help you set something up if you have images and such.

DISCLAIMER: The treemenu is NOT supported. It has not been released, and I don't believe that it [this particular program] is being developed now, though there is one in development that has not even reach beta stage yet. The treemenu.js module has been left in the module section because many people use the collapse menu without any kind of fancy setups, just a simple menu that they have used with absolute position [i.e. top=; left= positioning] and so Andy has kept the module up to date for those clients. If you are trying to position this menu relatively, the only way you can do that is to place the table AFTER the lists themselves since the menu must have the lists in order to build itself.

Hope this helps. If you need more help, I'd actually have to have the page and stuff with which to work and I'm going to be gone this afternoon and probably most of tomorrow.
Ruth

Re: Trouble still embedding treemenu...


Poster: nwilcox
Dated: Thursday February 14 2008 - 14:50:41 GMT

wow thanks! I'll give that a try!!! :D

What do you mean by putting a table after the menu for relative? I'm a little lost there

Re: Trouble still embedding treemenu...


Poster: nwilcox
Dated: Thursday February 14 2008 - 16:01:16 GMT

that didn't work... am I doing something wrong? The menu tries to open but then an error is thrown...

"$_E is not defined"

http://clients2.serverside.net/serversi ... _tree.html

Code:
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=2;
_subOffsetLeft=-2;
AllMargin=0;
treeOffset=0;
singleMasterMenu=true;

with(menuStyle=new mm_style()){
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
fontfamily="Verdana, Tahoma, Arial";
fontsize="75%";
fontstyle="normal";
headerbgcolor="#ffffff";
headercolor="#000000";
offbgcolor="#eeeeee";
offcolor="#000000";
onbgcolor="#ddffdd";
oncolor="#000099";
outfilter="randomdissolve(duration=0.3)";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=3)";
padding=4;
pagebgcolor="#82B6D7";
pagecolor="black";
separatorcolor="#999999";
separatorsize=1;
subimage="../../arrow.gif";
subimagepadding=2;
}

with(menuStyle2=new mm_style()){
bordercolor="#999999";
borderstyle="solid";
borderwidth=1;
fontfamily="Arial";
fontsize="14px";
fontstyle="normal";
offbgcolor="darkblue";
offcolor="yellow";
onbgcolor="#ffffff";
oncolor="#ff0000";
padding="6px"
itemwidth=240;
type="tree";
}

Re: Trouble still embedding treemenu...


Poster: Ruth
Dated: Thursday February 14 2008 - 17:20:56 GMT

Hi,

You need to upgrade the menu files, you're down 3 levels and something which got fixed in a later version fixed whatever the problem is in that version with the treemenu.

Ruth

Re: Trouble still embedding treemenu...


Poster: nwilcox
Dated: Thursday February 14 2008 - 17:38:15 GMT

excellent find Ruth! Works like a champ...

Again you've saved the day. Many thanks

Re: Trouble still embedding treemenu...


Poster: Ruth
Dated: Thursday February 14 2008 - 18:19:17 GMT

Oh, I forgot about the table thingee. If you want the menu in a table, and are building it from lists, then you need to make sure the menu coding is in the table and the table is after the lists on the page. It has to be able to read the lists to build it, so if you put the table at the top and the lists after the table, well it doesn't see the list to build the menu until after the table is loaded and therefore the menu doesn't show. Also, don't forget, the on thing that is a problem with the treemenu is when you position it relatively, you have the Mozilla fixZindex problem. That needs to be set to false, not true, if you are placing the treemenu as positioned relative. Make sure you test that and if it doesn't fix it in all browsers, then there is nothing that can be done since the treemenu is not supported, not released and I'm not sure this one is still being developed. It is why I said at the beginning that there was no Milonic support for it.

Ruth