gpt4 book ai didi

jquery - 在搜索框外显示 select2 多项选择

转载 作者:行者123 更新时间:2023-11-28 11:04:44 24 4
gpt4 key购买 nike

有没有办法在搜索框外显示select2个选中的元素?
我现在拥有的:
这是一个示例 fiddle :
enter image description here
但我想要的是:
enter image description here

.select2-search-choice{
width:100%
}
<select multiple id="e1" style="width:300px">
<option value="AL">Alabama</option>
<option value="Am">Amalapuram</option>
<option value="An">Anakapalli</option>
<option value="Ak">Akkayapalem</option>
<option value="WY">Wyoming</option>
</select>

最佳答案

现在您已将其设置为溢出:隐藏;。通过继承取消它,然后设置您希望答案离顶部多远。

http://jsfiddle.net/q2hp451y/3/

.select2-search-choice{
width:100%
}

.select2-container-multi .select2-choices {
overflow: inherit;
}

.select2-container-multi .select2-choices .select2-search-choice {
top: 30px;
width: 270px;
}

关于jquery - 在搜索框外显示 select2 多项选择,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39668210/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com