如何更改顶部的Bootstrap multiselect下拉位置?

时间:2015-05-21 10:36:28

标签: jquery html5 twitter-bootstrap multi-select bootstrap-multiselect

我试图在顶部更改bootstrap multiselect下拉菜单的位置,但没有运气。下面而不是使用权利如何显示控制权。

<select id="example-dropRight" multiple="multiple">
    <option value="1">Option 1</option>
    <option value="2">Option 2</option>
    <option value="3">Option 3</option>
    <option value="4">Option 4</option>
    <option value="5">Option 5</option>
    <option value="6">Option 6</option>
</select>

<script type="text/javascript">
    $(document).ready(function() {
        $('#example-dropRight').multiselect({
            buttonWidth: '400px',
            **dropRight: true**
        });
    });
</script>

2 个答案:

答案 0 :(得分:1)

你可以这样做...... DEMO

<div class="btn-group dropup" style=" margin: 100px;">
  <button class="btn">Dropup</button>
  <button class="btn dropdown-toggle" data-toggle="dropdown">
    <span class="caret"></span>
  </button>
 <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
  <li><a tabindex="-1" href="#">Action</a></li>
  <li><a tabindex="-1" href="#">Another action</a></li>
  <li><a tabindex="-1" href="#">Something else here</a></li>
  <li class="divider"></li>
  <li><a tabindex="-1" href="#">Separated link</a></li>
</ul>
</div>

答案 1 :(得分:1)

这是我的回答: <div class="**dropup**"><select id="example-dropRight" multiple="multiple"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> <option value="4">Option 4</option> <option value="5">Option 5</option> <option value="6">Option 6</option> </select> </div>