【发布时间】:2016-04-26 14:15:20
【问题描述】:
我正在尝试在我的 html 中通过引导程序使用多个 select2 选择表单。但是我遇到了大小问题,select2 框不能与网格一起使用,而且它还会影响下一个项目的大小。 html
<div class="select2-container col-md-11">
<select class="form-control s2" id="complaint" multiple="multiple" name=
"complaint[]">
<option value="bad_breath">
Bad Breath
</option>
<option value="bleeding_gum">
Bleeding Gum
</option>
<option value="swollen_gum">
Swollen Gum
</option>
<option value="gum_pain">
Gum Pain
</option>
<option value="loose_teeth">
Loose Teeth
</option>
<option value="sensitive_teeth">
Sensitive Teeth
</option>
<option value="darkened_teeth">
Darkened Teeth
</option>
<option value="damaged_teeth">
Damaged Teeth
</option>
</select>
</div>
JS
<script type="text/javascript">
$(".s2").select2({
closeOnSelect: false
});
$(document).ready(function() {});
【问题讨论】:
-
这个帖子太晚了,但是如果有人使用select2.org中的select2,那么请检查这个链接select2.org/appearance,它有设置控件宽度的方法。
标签: javascript html css twitter-bootstrap select2