使用Bootstrap Select禁用下拉功能 [英] Disable dropup feature using Bootstrap Select
本文介绍了使用Bootstrap Select禁用下拉功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Bootstrap Select来设置手风琴中某些选择字段的样式. Bootstrap select具有一项功能,如果它位于屏幕底部附近,它将使您的下拉菜单变为下拉菜单.
I'm using Bootstrap Select to style some select fields inside an accordion. Bootstrap select has a feature where it will make your dropdown dropup if it is near the bottom of the screen.
在这种情况下,我不希望它掉落,但找不到在何处禁用它.
In this case I do not want it to drop up but I can't find where to disable this.
引导程序选择: https://developer.snapappointments.com/bootstrap-select/
推荐答案
可以通过JavaScript或数据属性传递选项:
Options can be passed via JavaScript or data attributes:
$('.selectpicker').selectpicker({
dropupAuto: false
});
或
<select class="selectpicker" data-dropup-auto="false">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>
您也可以全局设置:
$.fn.selectpicker.Constructor.DEFAULTS.dropupAuto = false;
这篇关于使用Bootstrap Select禁用下拉功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文