Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS Jquery vertical navigation menu with horizontal submenus
    primarykey
    data
    text
    <p>I'd like to create a navigation menu like this:</p> <pre><code>|main-item1| |main-item2| |sub-item1| |sub-item2| |sub-item3| |main-item3| |main-item4| </code></pre> <p>what I see now is this:</p> <pre><code>|main-item1| |main-item2| |sub-item1| |sub-item2| |sub-item3| |main-item3| |main-item4| </code></pre> <p>I've found another question like this here on stackoverflow, but I couldn't manage to adapt the code.</p> <p>The html code I have is this:</p> <pre><code> &lt;div&gt; &lt;nav&gt; &lt;ul id="mainmenu"&gt; &lt;li&gt;&lt;a href="chi_siamo"&gt;Chi siamo&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="servizi"&gt;Servizi&lt;/a&gt; &lt;ul class="submenu"&gt; &lt;li&gt; &lt;a href="speciale"&gt;speciale&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="#"&gt;privati&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href=""&gt;aziende&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href=""&gt;cerimonie&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href=""&gt;consulenza&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="location"&gt;Location&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="contatti"&gt;contatti&lt;/a&gt;&lt;/li&gt; &lt;li class="last"&gt;&lt;a href="partner"&gt;partner&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;/div&gt; </code></pre> <p>And this is the css:</p> <pre><code> #mainmenu { position: fixed; left: 20px; top: 50%; z-index: 999999; margin-top:-200px; } #mainmenu li { height: 40px; margin: 5px; position: relative; } #mainmenu a { background: none repeat scroll 0 0 #333; color: #fff; display: block; font-family: Folio; font-size: 30px; padding: 2px 15px; text-decoration: none; text-transform: uppercase; width: 160px; height: 40px; /*background: url(Images/dotnav.png) 0 100% no-repeat;*/ /*text-indent: -10000px;*/ overflow: hidden; } #mainmenu a:hover, #mainmenu li.active a { background-position: 0 0; } .submenu { list-style-type: none; position:relative; float:left; } .submenu li { display: inline; float:left; position:relative } </code></pre> <p>It would be ok to use some jquery plugin, also because I'd like to add some effect on hovering, but I thought it was better to align everything with css first.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload