Bootstrap-Select打开div下的选项 [英] Bootstrap-Select opens option under the div
问题描述
我有一个固定大小的div。假设50px。里面有一个下拉。我已使用引导选择使其可搜索。
I have a fixed size div. suppose 50px. Inside that I have a drop down. I've used bootstrap select to make it searchable.
<div style="height=40px;width:200%; overflow-x:scroll;" id="hugewidth">
<select id="ss">
<option>1</option>
<option>1</option>
<option>1</option>
<option>1</option>
<option>1</option>
</select>
<br/><br/><br/>
</div>
现在的问题是当我打开下拉列表,选项在 hugewidth
div。我想要下拉框打开上面的div。请参阅可以清除问题的JSFiddle。
Now problem is when I open the dropdown , options goes under the hugewidth
div. I want the dropdown to open above that div. See the JSFiddle that might clear the problem.
查看!它在滚动条下。任何人都可以帮我这个?
我想要下拉选项div滚动滚动条。如果不可能,那么有什么办法根据下拉选项大小调整div的高度,同时打开和关闭? 下拉选项是动态的。
See!! It goes under the scrollbar. Can anyone please help me with this?? I want the dropdown option div to go over the scrollbar. If not possible, then is there any way to adjust the div height according to the dropdown option size while open and close? Dropdown options are dynamic.
还有一件事。是否可以阻止下拉菜单向上打开?示例: JSFiddle
One more thing. Is it possible to stop a dropdown to open upwards? Example: JSFiddle
推荐答案
您可以添加:
data-container="body"
选择元素。或另一个元素来显示下拉列表。请参阅:
http://jsfiddle.net/IceManSpy/Y9hyD/2/
to select element. Or another element to show dropdown over there. See it: http://jsfiddle.net/IceManSpy/Y9hyD/2/
这篇关于Bootstrap-Select打开div下的选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!