twitter-bootstrap 将可滚动选项添加到多选 jquery

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31285928/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 22:54:52  来源:igfitidea点击:

add scrollable option into multiselect jquery

jquerytwitter-bootstrapscrollmulti-select

提问by kamal

I use dropdownlist in this demo. My list is larger than this demo that's why I want add scrollable option. How can I add scrollable option into dropdown

我在这个演示中使用了下拉列表。我的列表比这个演示大,这就是我想要添加可滚动选项的原因。如何将可滚动选项添加到下拉列表中

采纳答案by FurkanO

For the ul element in the example, you can simply set a fixed height and set the overflow-y property as scroll. For the example in your link;

对于示例中的 ul 元素,您可以简单地设置固定高度并将溢出-y 属性设置为滚动。对于您链接中的示例;

ul {height:50px;overflow-y:scroll;}

回答by Priyal

As per documentation. Just add this parameter. maxHeight: 450

根据文档。只需添加此参数。最大高度:450

e.g

例如

$("#id").multiselect({
         enableFiltering: true,
         maxHeight: 450      
 });