Page 1 of 1

[SOLVED] - Display "CSSMenu - Horizontal" SubMenus Horizontally

Posted: Mon Feb 16, 2009 6:55 pm
by darinsee
Hello,

I am using CMSMS 1.5.2 "Caugas" and PHP 5.2.3 and MySQL 5.0.67

I'm trying to get the submenus from the default "CSSMenu - Horizontal" stylesheet, to display horizontally (instead of vertically) - but try as I might, I can't get it to work - can anyone advise?

Thank You!

P.S.   - > Here is an example of a menu that works the way that I'm trying to replicate: http://www.lwis.net/free-css-drop-down- ... inear.html

P.P.S. - > Here is the unmodified CSSMenu:

Code: Select all

        /* Horizontal menu for the CMS CSS Menu Module */
        /* by Alexander Endresen */

        #menu_vert {
           margin-left: 1px;
           margin-right: 1px;
        }

        /* The wrapper clears the floating elements of the menu */

        /* Fix for Opera 8 */
        .clearb { clear: both; }
        #menuwrapper { 
           /* Fix for Opera 8 */ 
           /*   overflow: hidden;  */ 
           background-color: #ECECEC;
           border-bottom: 1px solid #C0C0C0;
           width: 100%;
        }

        /* Set the width of the menu elements at second level. Leaving first level flexible. */
        #primary-nav li li { 
           width: 200px; 
        }


        /* Unless you know what you do, do not touch this */ 
        #primary-nav, #primary-nav ul { 
           list-style: none; 
           margin: 0px; 
           padding: 0px; 
        }
        #primary-nav ul { 
           position: absolute; 
           top: auto; 
           display: none; 
        }
        #primary-nav ul ul { 
           margin-top: 1px;
           margin-left: -1px;
           left: 100%; 
           top: 0px; 
        }
        	
        #primary-nav li { 
           margin-left: -1px;
           float: left; 
        }
        #primary-nav li li { 
           margin-left: 0px;
           margin-top: -1px;
           float: none; 
           position: relative; 
        }

        /* Styling the basic apperance of the menu elements */
        #primary-nav a { 
           display: block; 
           margin: 0px; 
           padding: 5px 10px; 
           text-decoration: none; 
           color: #006699;
        }
        #primary-nav li a { 
           border-right: 1px solid #C0C0C0;
           border-left: 1px solid #C0C0C0;
        }
        #primary-nav li li a { 
           border: 1px solid #C0C0C0;
        }	
        #primary-nav li, #primary-nav li.menuparent { 
           background-color: #ececec; 
        }

        /* Styling the basic apperance of the active page elements (shows what page in the menu is being displayed) */

        #primary-nav li.menuactive { 
           background-color: #C7C7C7; 
        }


        /* Styling the basic apperance of the menuparents - here styled the same on hover (fixes IE bug) */
        #primary-nav ul li.menuparent, 
        #primary-nav ul li.menuparent:hover, 
        #primary-nav ul li.menuparenth { 
        /* arrow for menuparents */
           background-image: url(images/cms/arrow.gif); 
           background-position: center right; 
           background-repeat: no-repeat; 
        }


        /* Styling the apperance of menu items on hover */

        #primary-nav li:hover, 
        #primary-nav li.menuh, 
        #primary-nav li.menuparenth, 
        #primary-nav li.menuactiveh { 
           background-color: #E7AB0B; 
        }


        /* The magic - set to work for up to a 3 level menu, but can be increased unlimited */

        /* 
        just add 
        #primary-nav li:hover ul ul, 
        #primary-nav li.menuparenth ul ul ul,
        for fourth level 
        */
        #primary-nav ul, 
        #primary-nav li:hover ul, 
        #primary-nav li:hover ul ul, 
        #primary-nav li.menuparenth ul, 
        #primary-nav li.menuparenth ul ul { 
           display: none; 
        }

        /* add 
        #primary-nav ul ul ul li:hover ul, 
        #primary-nav ul ul ul li.menuparenth ul,
        for fourth level
        */
        #primary-nav li:hover ul, 
        #primary-nav ul li:hover ul, 
        #primary-nav ul ul li:hover ul, 
        #primary-nav li.menuparenth ul, 
        #primary-nav ul li.menuparenth ul, 
        #primary-nav ul ul li.menuparenth ul { 
           display: block; 
        }


        /* IE Hacks */
        #primary-nav li li { 
           float: left; 
           clear: both; 
        }
        #primary-nav li li a { 
           height: 1%; 
        }

Re: Display "CSSMenu - Horizontal" SubMenus Horizontally

Posted: Tue Feb 17, 2009 12:16 pm
by darinsee
As a note, what I've tried to do so far, is to change this block:

Code: Select all

        #primary-nav li:hover ul, 
        #primary-nav ul li:hover ul, 
        #primary-nav ul ul li:hover ul, 
        #primary-nav li.menuparenth ul, 
        #primary-nav ul li.menuparenth ul, 
        #primary-nav ul ul li.menuparenth ul 
        { 
           display: block; 
        }
To this:

Code: Select all

        #primary-nav li:hover ul, 
        #primary-nav ul li:hover ul, 
        #primary-nav ul ul li:hover ul, 
        #primary-nav li.menuparenth ul, 
        #primary-nav ul li.menuparenth ul, 
        #primary-nav ul ul li.menuparenth ul 
        { 
           display: inline;
        }
But that change doesn't do the trick.



I have also added this, but again to no avail:

Code: Select all

     
        #primary-nav li ul li 
        { 
           float: left; 
        }
Any ideas are greatly appreciated, thank you!

[SOLVED] : Display "CSSMenu - Horizontal" SubMenus Horizontally

Posted: Tue Feb 17, 2009 1:44 pm
by darinsee
Well, I went ahead and hacked the lwis.net linear menu, and used the original CSSMenu ID (primary-nav) to achieve the functionality I was looking for - in case it helps someone else, here's the css that I'm now using instead of the original CSSMenu-Horizontal css:

Code: Select all

#primary-nav,
#primary-nav li,
#primary-nav ul {
 list-style: none; 
 margin: 0;
 padding: 0;
}

#primary-nav {
 position: relative;
 float: right;
 background-color: #012745;  
}

#primary-nav a, a:active, a:visited {
 color: #FFFFFF;             
 line-height: 36px;        
 font-family: Tahoma;       
 font-size: 15px;           
 text-decoration: none;   
}
#primary-nav a:hover {
 color: #dcbb6e;
}

#primary-nav li {
 float: right;             
 vertical-align: middle;
 padding-right: 7px;
 padding-left: 7px;
}

#primary-nav li.hover,
#primary-nav li:hover {
 position: relative;
 cursor: default;
}

#primary-nav ul {
 visibility: hidden;
 position: absolute;
 top: 100%;              /* needed for ie7 otherwise sub shows under main nav */
 right: 0px;
 border-top: none;
 border-left: solid 1px #c3cbd1;
 border-bottom: solid 1px #c3cbd1;
 border-right: solid 1px #c3cbd1;      
 background-color: #f3f4f4;
 width: 968px;
}

#primary-nav ul a, a:active, a:visited {
 color: #6693b7;             
 line-height: 32px;         
 font-family: Tahoma;      
 font-size: 12px;           
 text-decoration: none;     
}
#primary-nav ul a:hover {
 color: #dcbb6e;
 text-decoration: underline;
}

#primary-nav ul li {
 float: right;              
}

#primary-nav li:hover > ul {
 visibility: visible;
}

#primary-nav li.hover,       
#primary-nav li:hover {
 position: static;
}

Re: [SOLVED] - Display "CSSMenu - Horizontal" SubMenus Horizontally

Posted: Tue Mar 24, 2009 11:16 pm
by stevegos
Many thanks for posting this. I looked on the web extensively and almost gave up trying to get this working.

Your css works perfectly.

Steve

Re: [SOLVED] - Display "CSSMenu - Horizontal" SubMenus Horizontally

Posted: Wed Aug 26, 2009 10:02 am
by Evert B.
Hi all,

I realise this is an old topic, but hopefully you can still help me out.

If I add this code to a stylesheet which I connect to the template it doesn't show anything at all. No menu what so ever.

Can some please give me the code to add in the template which would probably be something like this:

Code: Select all

<div id="primary-nav">
{menu template='cssmenu.tpl'}
</div>
I understand that the stylesheet above is the stylesheet that should create this menu, or is it just a part of this stylesheet?
Is there something else that should be done besides the stylesheet and code in template?

Thanks in advance - Nucleus

Re: [SOLVED] - Display "CSSMenu - Horizontal" SubMenus Horizontally

Posted: Sun Aug 30, 2009 8:30 pm
by Dr.CSS
The #primary-nav refers to the UL in the menu, all cssmenu templates use and all IDs have to be unique so if it has 2 you will get problems...