View Full Version : Problem with suckerfish menu

Feb 28th, 2009, 09:28 PM
Hi all !

I'm making a suckerfish menu wich works fine .

Now i want to add a third level to my menu but i can't figure out how i could do this.

here is my css :

ul { /* all lists */
padding: 0;
margin: 0;
list-style: none;

li { /* all list items */
float: left;
position: relative;
width: 114px;
margin-top: 0px;
height: 20px;
border-right: 1px;
border-right-color : #ffffff;
border-right-style: solid;
font-size: 12px;

li ul { /* second-level lists */
display: none;
position: absolute;
top: 22px;
left: 0;

li>ul { /* to override top and left in browsers other than IE, which will position to the top right of the containing li, rather than bottom left */
top: auto;
left: 0;

li:hover ul, li.over ul { /* lists nested under hovered list items */
display: block;

and here is the javascript.

startList = function() {
if (document.all && document.getElementById) {
navRoot = document.getElementById("nav");
for (i = 0; i < navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName == "LI") {
node.onmouseover = function() {
this.className += " over";
node.onmouseout = function() {
this.className = this.className.replace(" over", "");
window.onload = startList;

Can someone help me out ?

thx in advance !

Mar 1st, 2009, 07:36 AM
Here's a Multi-level Suckerfish menu I made.


Hopefully you can find the answer within it (source code contains everything). Yours is using the old Suckerfish JavaScript method, which they improved upon dramatically (see here (http://htmldog.com/articles/suckerfish/dropdowns/)). This one doesn't use the silly li>ul hack, and the JavaScript is only acknowledged in IE and no where else where it's moot anyway. It's CSS hack free.

Hopefully it helps you. Run into anymore problems, feel free to tell me.