admin管理员组文章数量:1277901
I am very glad to use this wonderful library - jQuery Nice Select link. But i cant understand why this not support scroll bar especially in google chrome
Chrome :
And Firefox
I can't understand why google chrome doesn't support scroll bar or I should add it somehow?
I am very glad to use this wonderful library - jQuery Nice Select link. But i cant understand why this not support scroll bar especially in google chrome
Chrome :
And Firefox
I can't understand why google chrome doesn't support scroll bar or I should add it somehow?
Share Improve this question edited Jan 28, 2021 at 18:38 dreamcrash 51.6k26 gold badges110 silver badges131 bronze badges asked Jan 25, 2021 at 21:07 Nikola MarinovNikola Marinov 2633 silver badges15 bronze badges 03 Answers
Reset to default 11This isn't related to Firefox or Chrome. You may just be looking at the browsers with different viewports.
In any case, you need to add this to your CSS to add a scrollbar:
.list {
max-height: 100px; // or whatever the height you want
overflow-y: scroll !important;
}
Source: tested it myself in both Chrome and Firefox.
I know this is a kind of late, but the accepted answer didn't work for me. I had to use the code below to make it work (maybe for a newer version of library):
.nice-select-dropdown .list {
height: 100% !important;
max-height: 100% !important;
overflow: auto !important;
}
.nice-select.open .nice-select-dropdown {
max-height: 240px; /*or whatever height you want*/
overflow-y: auto;
overflow-x: hidden;
}
Try this out...
NOTE: This hides the scrollbar, so some people who prefer scrollbars over gestures may have some trouble accessing your site
/* Hide scrollbar for IE, Edge and Firefox */
.example {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
Credits w3schools
本文标签: javascriptjQuery Nice Select with scroll barStack Overflow
版权声明:本文标题:javascript - jQuery Nice Select with scroll bar - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741209364a2358795.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论