javascript - 如何管理选择框中的水平和垂直滚动条?

标签 javascript jquery html css

我想在选择框中添加水平滚动条。我已尝试使用以下代码示例的 div 部分,但是

 <div id="topicsInterest_id" style="width:180px;height:280px;overflow-y:hidden;overflow-x:scroll;">

            <select id="topicsinterest" name="topicsinterest" multiple="multiple" style="width:400px;height:270px;" class="inputtxtbox">
             <option> ...</option>
            </select>
 </div> 

但是客户说主题列表上的滚动框等垂直滚动条..看不见了?它应该在右侧可见。

请帮助如何在选择框中使用水平滚动条管理垂直滚动,例如 enter image description here

谢谢

最佳答案

看到这个demo

您只需删除 overflow-y:hidden;overflow-x:scroll; 并将其设置为

overflow:auto;   // show Scroll when Required`  

或者

overflow:scroll;  //if you want to show scroll always

关于javascript - 如何管理选择框中的水平和垂直滚动条?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12669645/

相关文章:

javascript - 无法更改 Bootstrap 工具提示标题

html - 如何在go模板中传入map "created on the way"

javascript - 使用javascript在html中创建动态元素

javascript - 无法使用javascript将gif添加到网页

jquery - xmlhttprequest 和 $.ajax(), $.load 之间的区别

php - 如何将动态数据加载到谷歌饼图中?

jquery获取id并 append .html和toggleClass

javascript - 导航栏水平折叠并显示导航项

javascript - Firebase 数据库查询返回 null(函数)

javascript - 复制选中复选框的行的选定值