-
Notifications
You must be signed in to change notification settings - Fork 862
How to make dropdowns in main nav open right #862
Comments
Hi @adambundy, You can update your navigation (assets/scss/modules) Sass with something similar like this, I have not tested it, but let me know the results and good luck! .top-bar .dropdown.menu > li.opens-left > .is-dropdown-submenu { .top-bar .dropdown.menu .submenu::after { |
@urbankid thanks very much for the response. I have always just forced this back to positioning these left-aligned with CSS, but I cant figure out how to change it in the markup which would be better for flexibility. Note that the first level LI items (.desktop-menu > li) get the class 'opens-left' assigned to them which makes the dropdown menus go left, but I cant see any way to change that. In the Fdn6 docs, the dropdown menu component has a data-alignment option for left or right, but adding this option to the Foundationpress_Top_Bar_Walker function doesn't seem to do anything. Im stumped. Any insight? Thanks much @urbankid! |
... @urbankid could this be the answer? http://foundation.zurb.com/forum/posts/38246#comment_33383 Fdn makes all menus in the top-right area go right?? |
@adambundy I'm having the same problem. The dropdown alignment is apparently controlled by foundation.dropdownMenu.js. You can change the default value (left) via the data-options attribute (http://foundation.zurb.com/sites/docs/javascript.html#configuring-plugins for more info). I have no idea how I can add this attribute in foundationpress though. Have you found a solution yet (or maybe a better workaround)? |
In the latest version of FoundationPress, open
I know it's counter intuitive but it tells the js where the main parent menu is, relative to the sub menu. Also be aware that depending on where the menu is, the js will still push sub-menus left if there is no more space on the right. |
I have a much simpler solution. In library/navigation.php, find the desktop navigation function. In my version it's lines 18-37. Simply add data-alignment="left" to items_wrap like so:
|
What is the proper way to make dropdown menus in the main (desktop) nav open to the right (aligned with their parent item on the left)? They seem to default to left and no amount of changing the walkers will change the class 'opens-left' to right. I notice however that on the demo site, they do open to the right. ?? Thanks for any help.
The text was updated successfully, but these errors were encountered: