I have sticky top bar with dropdown menu. The menu contains many elements so in limited height screen size the rest of elements could not be access. I tried to add overflow to the ul of the menu as the the following:
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li class="has-dropdown">
<a href="#"><?php echo lang('Choose Source');?></a>
<!-- Adding overflow -->
<ul class="dropdown" style="overflow: scroll">
However, it just render a disabled scroll bar as the screen shot showing:
Is there any solution or alternative workaround?
I use Foundation 5.
When your CSS just shows a disabled scroll bar after setting overflow: scroll;
that is indicative of not setting the height on the object. Since you are dealing with Foundation top-bar you will need to set the height and use !important
in order to overwrite their styling of height: auto !important
.
Since you are open to alternatives I suggest transforming your long drop down into multiple columns. I have created a codepen example here.
Option One: Adds a scroll bar like you were originally wanting to accomplish. It is doable, but I not certain it lends itself to a good user experience. Orange arrow point to scrollbar.
Option Two: Is a simple two column that uses the dropdowns natural float left, so there is little additional markup. Option two may have a downside depending on how you want the reading order to be. Orange arrow signifying reading order using left to right with Option Two.
Option Three: Is a bit more markup but it keeps the reading order down column one then down column two. Orange arrow signifying reading order using left to right with Option Three.
Of course for both Option Two and Option Three you can extend it out to be as many columns as you want and you will need a media query to be sure the styles only affect screen sizes above your breakpoint.
If I have misunderstood your question please feel free to clarify and provide a codepen or jsfiddle to your PHP generated HTML.
If you have any questions let me know.
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句