html - How to add submenu to zurb foundation Side Nav -
I'm looking for side nav
with multilevel objects by default Zbust Foundation 5 The sub menu does not support due to the reason.
& lt; Ul class = "side-nav" & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Link 1 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Link 2 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li class = "divider" & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Link 3 & lt; / A & gt; & Lt; / Li & gt; & Lt; Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Link 1 & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Link 2 & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Link 4 & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt;
For sub-menus it can be changed to support submenus for sub-menus like a down arrow or + sign.
To do this, you have to change the side-nav markup and add some CSS and JS.
& lt; ul class = "side-nav">
Lt; li & gt; Link: 1 & lt; / a & gt; & lt; ul & gt; & lt ;! - UL added inside Lee - & gt; Lt; li & gt; & lt; a href = "#" & gt; Sub Link 1
<3> <3> & lt; / Li>
js
$ ('.pd- nav li: is ("ul")'). Children ('ul'). Hide submenu $ ('.ide-NAV li: is ("ul")'). AddClass ('haschildren'); // add class to li ul child $ ('.seed-nav li: has ("ul")). Click (function () {$ (this) .toggleClass ("active") // Click to add active category menu items $ (this) .Kids ('ul'). Slide toggle (); // Toggle submenu });
css
.hasChildren: {Before content: "+"; Swim left; } .hasChildren.active: {Before Content: "-"; }
Comments
Post a Comment