I love the jQuery UI stuff!
I like the navigation menu, but I can't seem to get it horizontal. I've got to be missing something that's a cinch.
Anyone know how to change the CSS? I tried this but it is for an older version and doesn't work, since there is no longer "clear" to keep them on top of each other.
Relevant CSS:
.ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
.ui-menu .ui-menu { margin-top: -3px; position: absolute; }
.ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
.ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
.ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
.ui-menu .ui-menu-item a.ui-state-focus,
.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
.ui-menu .ui-state-disabled a { cursor: default; }
Thanks for the help!
Just think about the jquery-ui menu as being the verticle dropdown when you hover over a topic on your main horizonal menu. That way, you have a separate jquery ui menu for each topic on your main menu. The horizonal main menu is just a collection of float:left divs wrapped in a mainmenu div. You then use the hover in and hover out to pop up each menu.
The showSubmenu function is simple - it just positions the submenu and shows it.
You then need to make sure the submenu is visible while your cursor is on it and disappears when you leave (this should be in your document.ready function.
Also don't forget to hide your submenus to start with - in the document.ready function
See the full code here
http://jsfiddle.net/R4nyn/
I'm new to stackoverflow, so please be nice :) however turning to the problem of horizontal jQuery ui menu, the only way I could manage to resolve the problem (refering to this) was to set:
I just been for 3 days looking for a jquery UI and CSS solution, I merge some code I saw, fix a little, and finally (along the other codes) I could make it work!
http://jsfiddle.net/Moatilliatta/97m6ty1a/
javascript
CSS
changing:
to:
should start you off.
Adding on to Mihalis Bagos answer. I have ended up doing the following:
This makes the top level menu horizontal but leaves any sub menus vertical.
I had to remove the icons as this was messing up the layout
There also seems to be a problem with the sub menu positioning.