I am trying to have my Share dropdown submenu content right aligned, not below Share
Here is my code:
<a href="#" data-dropdown="drop1" data-options="is_hover:true" >More</a>
<ul id="drop1" class="f-dropdown" data-dropdown-content>
<li>Infos</li>
<li class="has-dropdown" >Share
<ul class="dropdown" >
<li>This is a link</li>
<li>This is another</li>
<li>Yet another</li>
</ul>
</li>
<li>Third option</li>
</ul>
with custom css added to the original foundation one:
.has-dropdown ul{display:none;}
.has-dropdown:hover ul{display:block;}
The problem is that I cannot access Third option link, so I would like to have the This i a link, This another, Yet another submenu not below Share but just on the right...
As I found in the docs, I tried to add some data-options="align:right" like this:
<li class="has-dropdown" ><a data-options="align:right" href="#">Share</a>
... with no success... :(
EDIT1
With Sai Ram Sudheer answer, I have:
Not really better..
one way of doing is by aligning text in ul to right
.has-dropdown ul{display:none;}
.has-dropdown:hover ul{display:block;text-align:right;}
or you can use class right over li elements
<a href="#" data-dropdown="drop1" data-options="is_hover:true" >More</a>
<ul id="drop1" class="f-dropdown" data-dropdown-content>
<li>Infos</li>
<li class="has-dropdown" >Share
<ul class="dropdown" >
<li class="right">This is a link</li>
<li class="right">This is another</li>
<li class="right">Yet another</li>
</ul>
</li>
<li>Third option</li>
</ul>
oops i didn't get the question before.
I tried with data-options="align:left" but unable to get it to the right of main menu.
Check the navigation in this link that i did a while back .I used jquery and some css to get it.
Related
I am using trying to create vertical drop-down menu using purecss library but no success
purecss.io/menus/
My css code looks like:
<div class="pure-menu custom-restricted-width">
<ul class="pure-menu-list">
<li class="pure-menu-item pure-menu-has-children">
T-Shirts
<ul class="pure-menu-children">
<li class="pure-menu-item">
<a class="pure-menu-link" href="t-shirts-rundhals-tx-2-1,-1-2-.html">Rundhals</a>
</li>
<li class="pure-menu-item">
<a class="pure-menu-link" href="t-shirts-v-neck-tx-3-1,-1-3-.html">V-Neck</a>
</li>
<li class="pure-menu-item">
<a class="pure-menu-link" href="t-shirts-longsleeve-tx-4-1,-1-4-.html">Longsleeve</a>
</li>
<li class="pure-menu-item">
<a class="pure-menu-link" href="t-shirts-tanktop-tx-124-1,-1-124-.html">Tanktop</a>
</li>
</ul>
</li>
</ul>
</div>
Even I copy paste the sample code from their documentation and its not working too
jsBin
It's working fine just add css for custom-restricted-width because your pure-menu div content 100% width of the screen, so that you can not show the dropdown menu.
.custom-restricted-width{
display:inline-block;
}
Actually I would like to have horizontally scrollable menu with dropdowns smth like this:
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
<div class="pure-menu pure-menu-horizontal pure-menu-scrollable pure-menu-fixed">
Brand
<ul class="pure-menu-list">
<li class="pure-menu-item">Home</li>
<li class="pure-menu-item">Settings</li>
<li class="pure-menu-item">Log Out</li>
<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover">
Contact
<ul class="pure-menu-children">
<li class="pure-menu-item">Email</li>
<li class="pure-menu-item">Twitter</li>
<li class="pure-menu-item">Tumblr Blog</li>
</ul>
</li>
</ul>
</div>
But it does not work. Actually horizontal menu scrolling works, but dropdown does not(( I found out that it is because .pure-menu-scrollable and pure-menu-has-children classes can't get along. So at this point I can have or scrolling menu or menu with dropdown but not both at the same time.
Is there any way to make pure menu both scrollable and with dropdown?
I'm working on a site using the latest version of Foundation 5 SASS (downloaded a few days ago from https://github.com/zurb/bower-foundation).
When I create a top bar the menu-icon (the 3 horizontal lines) doesn't appear on mobile/small screens. It's just the 'MENU' text.
Here is my code:
<div class="contain-to-grid">
<nav class="top-bar" data-topbar>
<ul class="title-area">
<li class="name"></li>
<li class="toggle-topbar menu-icon"><span>Menu</span></li>
</ul>
<section class="top-bar-section">
<ul class="left">
<li>HOME</li>
<li class="has-dropdown">
ROOMS & FACILITIES
<ul class="dropdown">
<li>FIRST</li>
<li>SECOND</li>
<li>THIRD</li>
</ul>
</li>
<li>PRICES</li>
<li>THINGS TO DO</li>
<li>CONTACT</li>
</ul>
<ul class="right">
<li class="show-for-medium-up"><i class="fi-calendar calendar-icon"></i> CHECK AVAILABILITY</li>
</ul>
</section>
</nav>
</div>
Any help greatly appreciated. I've had a good look around already and can't find a solution. Most of the problems seemed to be from people omitting the span tags around the Menu text.
Thanks
the main thing is to have a <span> element. In the case of 2 examples below, the first one will NOT show the hamburger icon, but the second and the third one will.
<li class="toggle-topbar menu-icon ">Menu</li>
<li class="toggle-topbar menu-icon "><span>Menu</span></li>
<li class="toggle-topbar menu-icon "><span></span></li>
<li class="toggle-topbar menu-icon">
<span>MENU</span>
</li>
This works fine with latest (5.5.3) version
The menu-icon class should be in the tag.
<li class="toggle-topbar"><a class="menu-icon" href="#"><span>Menu</span></a></li>
There's a Foundation fix for this here which worked for me, for the top bar menu icon at least.
Is there a way to extend this designmodo example to allow for 3 levels of navigation?
I’d very much like to use this menu example, but I can’t figure out how to add a third level of functionality. Any help would be greatly appreciated!
Example:
http://designmodo.com/css3-accordion-menu/
Here is a fiddle that i'm working with: http://jsfiddle.net/johnstonian/r5rEZ/
Here is a sample menu i'm working with:
<ul class="accordion">
<li id="one" class="files">
My Files<span>495</span>
<ul class="sub-menu">
<li id="five">
<em>01</em>Dropbox<span>42</span>
<ul class="sub-menu">
<li><a><em>01</em>3rd Level<span>9</span></a></li>
<li><em>02</em>3rd Level<span>14</span></li>
<li><em>03</em>3rd Level<span>3</span></li>
</ul>
</li>
<li><em>02</em>Skydrive<span>87</span></li>
<li><em>03</em>FTP Server<span>366</span></li>
<li><em>01</em>Dropbox<span>42</span></li>
</ul>
</li>
<li id="two" class="mail">
Mail<span>26</span>
<ul class="sub-menu">
<li><em>01</em>Hotmail<span>9</span></li>
<li><em>02</em>Yahoo<span>14</span></li>
<li><em>03</em>Gmail<span>3</span></li>
</ul>
</li>
<li id="three" class="cloud">
Cloud<span>58</span>
<ul class="sub-menu">
<li><em>01</em>Connect<span>12</span></li>
<li><em>02</em>Profiles<span>19</span></li>
<li><em>03</em>Options<span>27</span></li>
</ul>
</li>
<li id="four" class="sign">
Sign Out
<ul class="sub-menu">
<li><em>01</em>Log Out</li>
<li><em>02</em>Delete Account</li>
<li><em>03</em>Freeze Account</li>
</ul>
</li>
</ul>
Use a menu designed for this, such as:
CSSPlay: Multi-Level Flyout Menu
CSSPlay: A cross-browser drop-down cascading validating menu
CSSPlay: The ULTIMATE CSS only drop-down menu
Here is the markup I'm using:
<ul class="menu">
<li id="planning_menuItem" class="menuItem">Estate Planning</li>
<ul class="subMenu">
<li id="will_menuItem" class="subMenuItem">Last Will & Testament</li>
<li id="poa_menuItem" class="subMenuItem">Power Of Attorney</li>
<li id="livingWill_menuItem" class="subMenuItem">Living Will</li>
<li id="trusts_menuItem" class="subMenuItem">Trusts</li>
</ul>
<li id="probate_menuItem" class="menuItem">
Estate Probate Administration
</li>
<li id="realEstate_menuItem" class="menuItem">Real Estate</li>
<li id="medicaid_MenuItem" class="menuItem">Medicaid</li>
<li id="guardianships_menuItem" class="menuItem">Guardianships</li>
</ul>
Is there anything stylistically wrong about having that "ul" (class=subMenu) in the middle of a list without it having it's own li tag? This particular mark-up solves my problem, but I want at least be aware of whether I'm breaking some standard or convention.
The alternative is as follows, but it doesn't work for my particular task.
<ul class="menu">
<li id="planning_menuItem" class="menuItem">Estate Planning
<ul class="subMenu">
<li id="will_menuItem" class="subMenuItem">Last Will & Testament</li>
<li id="poa_menuItem" class="subMenuItem">Power Of Attorney</li>
<li id="livingWill_menuItem" class="subMenuItem">Living Will</li>
<li id="trusts_menuItem" class="subMenuItem">Trusts</li>
</ul>
</li>
<li id="probate_menuItem" class="menuItem">
Estate Probate Administration
</li>
<li id="realEstate_menuItem" class="menuItem">Real Estate</li>
<li id="medicaid_MenuItem" class="menuItem">Medicaid</li>
<li id="guardianships_menuItem" class="menuItem">Guardianships</li>
</ul>
Thanks!
Yes, there is something wrong, <ul>'s can be inside of <li>'s, but not other <ul>'s.
This is correct...
<ul>
<li>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</li>
<li></li>
<li></li>
<li></li>
</ul>
According to the HTML DTD, you cannot have a <ul> directly under another <ul>. You should nest it inside a <li>.
If you're worried about the additional padding/margins, you can remove them with a rule that only applies to <ul> elements as direct children of <li> elements:
li > ul { margin: 0; padding: 0 }
(Or experiment with the best setting for your style)
BELOW is proper way
<ul class="menu">
<li id="planning_menuItem" class="menuItem">
Estate Planning
</li>
<li>
<ul class="subMenu">
<li id="will_menuItem" class="subMenuItem">
Last Will & Testament
</li>
<li id="poa_menuItem" class="subMenuItem">
Power Of Attorney
</li>
<li id="livingWill_menuItem" class="subMenuItem">
Living Will
</li>
<li id="trusts_menuItem" class="subMenuItem">
Trusts
</li>
</ul>
</li>
<li id="probate_menuItem" class="menuItem">
Estate Probate Administration
</li>
<li id="realEstate_menuItem" class="menuItem">
Real Estate
</li>
<li id="medicaid_MenuItem" class="menuItem">
Medicaid
</li>
<li id="guardianships_menuItem" class="menuItem">
Guardianships
</li>
</ul>
as others have said the second way is valid
here's a forked jsfiddle showing some new CSS which should help
summary is that you want to keep the ul's and their li's full width no side padding or margins, so reset all ul's; then make the a's display block so they fill their parent li's - then use text-indent to create the indented look of the li's
then however you choose to apply an "active or selected" class - apply it to the li OR a and any hover changes can be made too.