使用 Bootstrap Select 禁用下拉功能 [英] Disable dropup feature using Bootstrap Select

查看:46
本文介绍了使用 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆