... and what do you mean by breaking? Are you getting an error message or just not getting the required ouput?
>S'Plug<
Main Topics
Browse All TopicsHiya
I have the current XSL that outputs a Javascript menu fine, but it is now required to each each item in it's menu (top layer) a different colour how would i do this?
e.g.
Students (Red) > children items etc..
Teachers (Green) > children items etc..
Staff (Blue) > children items etc..
The code for the top layer menu is as follows:
//vertical main menu
addmenu(menu=[
"mainmenu",
0,
0,
144,
1,
,
style1,
1,
"left",
,
,
0,
,
,
,
,
,
,
,
,
,]]><xsl:for-each select="LmipMenu/Item">
<![CDATA[,"]]><xsl:value-o
<![CDATA[])]]>
I was trying to get it to use a different style (style1) but it kept breaking?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
To All Experts,
A request has been made in Community Support to close this question:
http://www.experts-exchang
If there are no objection, after 72 hrs, a moderator will finalize this question by saving this Q as a PAQ and refunding the points.
Please leave any recommendations here.
Joana,
Please provide the solution that you learned from work. It will be instructive for all of us.
Best regards,
YensidMod
Experts Exchange Moderator
Email from my workmate about it :-)
In function hl() of mmenu.js (which is the function that renders each menu item), I checked if this was the top level menu and if so identified which submenu that item was going to access and selected a hardcoded colour accordingly.
if (menu[0]=="mainmenu")
{
if(menu[b-3]=="show-menu=1
onb=cHexColor('green');
else if(menu[b-3]=="show-menu=2
onb=cHexColor('red');
else if(menu[b-3]=="show-menu=3
onb=cHexColor('blue');
}
This has the obvious drawback of requiring us to manually adjust the colours in mmenu.js to match those of style1, style2, style3 etc which currently correspond to menus for top level items 1,2 and 3 respectively. Furthermore when we add more entries to the top level menu we will also have to add them here. I hate it.
The alternative is to add a new optional parameter to the end of each menu item passed into addMenu() like so;
OLD :
,"Learners / Students<br><font color=#FF6600></font>","sh
NEW (the first line shows it not being passed, but an additional comma is required):
,"Learners / Students<br><font color=#FF6600></font>","sh
,"Learners / Students<br><font color=#FF6600></font>","sh
If present, mmenu.js could pass this into hl() and the above code would be reduced to something like;
if (customHighlight!="")
onb=cHexColor(customHighli
To accommodate the additional parameter would be relatively simple, with all the indexes in the loop of function dmenu() of mmenu.js needing to be incremented so that each menu item added now read 6 items instead of 5 per iteration.
Business Accounts
Answer for Membership
by: sparkplugPosted on 2003-06-06 at 02:47:57ID: 8664658
Hi,
You haven't really given us much to go on.
Where does the addmenu() function come from? Which parameters does it accept? What does the XML look like that you are applying this transform to? What namespace does the stylesheet use?
>S'Plug<