[TYPO3] mcuniverse - dropdown menu
Brian Bendtsen
brb at mentor-it.dk
Thu Jun 22 12:17:33 CEST 2006
Hi
Im trying to make a site with a drop down menu and found this:
http://www.mcuniverse.com/Horizontal_Multilevel_Dropdown_Me.1766.0.html
- it almost works, but im experiencing a few problems.
First I get a javascript error in IE:
An object is required line 4.
Not very helpful.
The error is not present i Firefox.
javascript:
activateMenu = function(nav) {
/* currentStyle restricts the Javascript to IE only */
if (document.all && document.getElementById(nav).currentStyle) {
var navroot = document.getElementById(nav);
/* Get all the list items within the menu */
var lis=navroot.getElementsByTagName("LI");
for (i=0; i<lis.length; i++) {
/* If the LI has another menu level */
if(lis[i].lastChild.tagName=="UL"){
/* assign the function to the LI */
lis[i].onmouseover=function() {
/* display the inner menu */
this.lastChild.style.display="block";
}
lis[i].onmouseout=function() {
this.lastChild.style.display="none";
}
}
}
}
}
Another problem is when I try to style the selected menu item.
I have this in my TS setup:
# Menu 1 cObject
lib.menu_1 = HMENU
lib.menu_1.1 = TMENU
lib.menu_1.1 {
expAll = 1
NO.ATagTitle.field = title
wrap = <UL id=nav> | </UL>
NO.wrapItemAndSub = <LI> | </LI>
ACT = 1
ACT.wrapItemAndSub = <LI id=sel> | </LI>
ACT.ATagTitle.field = title
}
lib.menu_1.2 = TMENU
lib.menu_1.2 {
expAll = 1
NO.ATagTitle.field = title
wrap = <UL id=level1> | </UL>
NO.wrapItemAndSub = </LI> | </LI>
ACT = 1
ACT.wrapItemAndSub = <LI id=sel> | </LI>
ACT.ATagTitle.field title
}
}
and my css:
#nav li#sel A {
background-color: #e3e3e3;
color: #FFF;
}
but the background-color is #555 as the other menu items.
Any ideas?
/Brian Bendtsen
More information about the TYPO3-english
mailing list