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:08

Collapsible Menu - expand all


Poster: indra
Dated: Wednesday April 5 2006 - 22:55:32 BST

I am trying to add an "Expand All" link to collapsible menu on this page:
http://www.milonic.com/treemenu/collaps ... se_data.js

I added these two items at the end of the main tree menu:

aI("text=<a href=# onclick=openAllBranches();>Expand All</a>;type=form;");
aI("text=<a href=# onclick=closeAllBranches();>Collapse All</a>;type=form;");

When I clicked on "Expand All", the last branch "US Markets" did not expand.

When I clicked on "Collapse All", the "Music" branch did not collapse but the arrow did change to point to right arrow.


Here is the source code. Just save it to an .html file
-------------------
<html>
<head>
<script>

</script>

</head>

<body>

<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="treemenu.js" type=text/javascript></SCRIPT>
<script type="text/javascript" src="/tmpl/openmenusbyurl.js"></script>

<script>

function changeCM(th)
{
if(!th.checked)singleMasterMenu=false; else singleMasterMenu=true
}
_scrollAmount=5 // Used for Netscape 4 scrolling
_scrollDelay=10 // Used for Netscape 4 scrolling

_menuCloseDelay=500 // The delay for menus to remain visible on mouse off
_menuOpenDelay=150 // The delay for opening menus on mouse over
_subOffsetTop=0; // Sub menu offset Top position
_subOffsetLeft=0; // Sub menu offset Left position

Goverfilter="Alpha(style=1,opacity=25,finishOpacity=100,startX=0,finishX=100,startY=100,finishY=0);Fade(duration=0.2);Shadow(color='#777777', Direction=135, Strength=5)"
Goverfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)"
Goutfilter="randomdissolve(duration=0.3)"
Goutfilter=""
Goverfilter=""

AllMargin=0

treeOffset=0; // Used to set the offset of sub menus
singleMasterMenu=false // Informs the system to on;y have one menu open at a time

with(tstyle1=new mm_style()){
offcolor = "#ffffff";
onbgcolor = "#D70B0B";
oncolor = "#FFFFFF";
offbgcolor="#006699"
ondecoration="underline"
borderstyle = "solid";
subimage="white_arrow.gif"
onsubimage="white_arrow_down.gif"
bordercolor="black"
borderwidth=1
padding = 2
fontsize = "80%";
fontfamily = "arial, verdana, tahoma";
subimageposition="top right" ;
separatorsize=1
separatorcolor="#003366";
image="trans.gif"
subimagepadding=3
imagepadding=2
itemwidth=200
}


sub1Style=new copyOf(tstyle1)
sub1Style.offcolor = "#ffffff";
sub1Style.offbgcolor="#8EA2BB"
sub1Style.separatorcolor="#556E8C"

sub2Style=new copyOf(tstyle1)
sub2Style.offcolor = "#000000";
sub2Style.offbgcolor="#D6DDE6"
sub2Style.separatorcolor="#8EA2BB"


tstyle1.clickcolor="#ffffff"
tstyle1.clickbgcolor="#D70B0B"
tstyle1.clickimage="red_blip.gif"
tstyle1.clicksubimage="white_arrow_down.gif"


with(new menuname("main Tree Menu")){
top=15
left=10
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 menu item with lots of text to demonstrate word wrapping;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;");
aI("text=<a href=# onclick=openAllBranches();>Expand All</a>;type=form;");
aI("text=<a href=# onclick=closeAllBranches();>Collapse All</a>;type=form;");
}

with(new menuname("News")){
style = sub1Style;
margin=AllMargin
aI("text=National;url=#");
aI("text=International;url=#");
aI("text=Technology;url=#");
aI("text=Politics;url=#");
aI("text=Campaign 2004;url=#");
aI("text=Health & Wellness;url=#");
}


with(new menuname("Finance")){
style = sub1Style;
margin=AllMargin
aI("text=MILONIC;url=#");
aI("text=US Markets;showmenu=US Markets;type=tree;image=lblue_blip.gif;overimage=red_blip.gif;");
aI("text=Portfolio;url=#");
aI("text=Watch list;url=#");
aI("text=Price Alert;url=#");
aI("text=Sectors;url=#");
aI("text=Advanced Chart;url=#");
}

with(new menuname("US Markets")){
style = sub2Style;
margin=AllMargin
aI("text=Market Snapshot;url=#");
aI("text=Market Movers;url=#");
aI("text=Word on The Street;url=#");
aI("text=Gainers/Losers;url=#");
aI("text=Most Actives;url=#");
aI("text=News;url=#");
}

with(new menuname("Sports")){
style = sub1Style;
margin=AllMargin
aI("text=MLB;url=#");
aI("text=NBA;url=#");
aI("text=NFL;url=#");
aI("text=NHL;url=#");
aI("text=College Sports;url=#");
aI("text=Golf;url=#");
}

with(new menuname("Entertainment")){
style = sub1Style;
margin=AllMargin
aI("text=Frssh;url=#");
aI("text=Cable TV Showcase;url=#");
aI("text=Movie Trailers;url=#");
}

with(new menuname("Music")){
style = sub1Style;
margin=AllMargin
aI("text=Broadband Music;url=#");

}

drawMenus()
</script>

</body>
</html>
---------------

Please help.

Thank you very much.


Poster: Andy
Dated: Monday April 10 2006 - 14:13:38 BST

Could you be using an old version of the treemenu.js file?

I have just tested your HTML and it works fine.

What version of treemenu.js are you using?


Poster: indra
Dated: Monday April 10 2006 - 16:54:58 BST

Andy wrote:
Could you be using an old version of the treemenu.js file?

I have just tested your HTML and it works fine.

What version of treemenu.js are you using?


Thanks Andy for looking into my problem.
I was using version 1.21. I just downloaded the newer version (1.23) this morning and got the same problem.

This is what happened:
- Click on the Expand All link and the "US Market" branch ddi not expand.
- Then click the Collapse All link and the "Music" branch did not collapse

I changed the "Portfolio" item to be menu and gave it a couple items.
- Click on the Expand All link and the "US Market" branch ddi expand but the "Portfolio" branch did not
- Then click the Collapse All link and the "Music" branch did not collapse

Thank you,
Indra