CSS Library: Vertical CSS Menus: Here
SuckerTree Vertical Menu (v1.1)
Author: Dynamic Drive
Nov 8th, 06: Fixed rendering issue in IE7, plus added support for automatic detection of sub menus width. No more configuring the "left" attributes!
This is a vertical, predominantly CSS based (with a touch of JavaScript) multi-level menu. It supports as many sub levels as you desire, plus multiple Suckertree menus on the same page. The CSS and JavaScript automatically adopts to your HTML code in each case.
The trick to Suckertree is a small adoptable piece of JavaScript that crawls the inner levels of a list menu and assigns the appropriate show/hide behavior to them. This differs from Suckerfish menu, which merely uses JavaScript to compensate for IE's shortcomings when it comes to CSS, so the menu is more rigid and requires manual changes to the CSS as the number of levels in your menu changes.
Demo:
The single image:
The CSS:
Rate this code:
Date Posted: 11/08/2006
Revision History: Updated Nov 8th, 06' to version 1.1
Usage Terms: Click here
Got a question or need help customizing this CSS code? Post it in the CSS Forums. If you have a comment or suggestion instead, post it in the comments section below.
Comment Pages 7 of 28 pages « First < 5 6 7 8 9 > Last »
I am however learning PHP at the mo, and I have written a function that populates this menu on the fly with categories and unlimited sub categories.
It needed a java tweak to work (but dont ask me why)
I changed:
ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px"
to be:
ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px"
If anyone would like the function to write out the menu then please feel free to ask, and if you want to see the menu workin on my local test server then its available at unisupuk.selfip.com (when im at home).
Now to get the horizontal version doing the same....Iv been at this for ove ten hours now, so maybe ill leave that till the morning! ;)
Here's the page with the navigation:
http://www.cymru66.com/runningetc/navtest.php
The problem is with the mouseover on the "Directions" and "Specials" links. See how the sub categories jump to the top of the DIV? Tried all sorts of things to fix it but with no success.
Many thanks in advance,
Steve
1. For some reason, the submenus will only show up in IE if you go back and then forward. It'll mess up if you refresh.
2. I want the submenus to have rounded corners, like the rest of the site. How would I do that?
http://www.sicksoft.com/phptest5
I really like this menu but I have two small problems:
1. A small 7-8px transparent gap appears at the end of the menu when there are sub links.
2. My border-bottom does not join up with the border-right on the outside of the menu.
I have spent ages trying to fix these but have had no luck, I don't know whether it is my div tags or the menu css. This problem occurs in ff and ie7 but not ie6. If you go to the 'school life' page you get a better view of what I mean.
Thanks alot.
http://www.cardinal-heenan.org.uk
In the text CSS, whereever applicable add a background color, I am using the 6 digit codes or CSS names such as maroon #800000, red #ff0000, orange #ffa500, yellow #ffff00, olive #808000, purple #800080, fuchsia #ff00ff, white #ffffff, lime #00ff00, green #008000, navy #000080, blue #0000ff, aqua #00ffff, teal #008080, black #000000, silver #c0c0c0, gray #808080
background-color: #FFFFFF;
I added a background to almost every option. I am not as skilled as most of you, so that is what worked for me. (I tried using #fff, but it did not work for me.)
hover color - just change the yellow
image change from arrows, keep same size, make sure they're in the correct directory for the path
watch the path on EVERYTHING & make sure your opening AND closing <ul> <liL </li> </ul> tags are in the right order.
Does anyone have BOTH the matching horizontal and vertical menus running? I had it and lost it... I also would like to keep the menu on a remote call, so the changes only need to be done once. I can only keep the horizontal (not this menu) one that way right now. Love this menu! Thank you again for creating it! Happy Holidays!
4um
"...
2. I want the submenus to have rounded corners, like the rest of the site. How would I do that?
http://www.sicksoft.com/phptest5
..."
Hope this helps with the rounded corners:
http://webdesign.about.com/od/css/a/aa072406.htm
4um
Arrg... I've even seen that article before, I just forgot about it.







