我正在使用 Bootstrap 的多选,我正在尝试添加字体很棒的图标......我将图标用作 unicode 但它不起作用。
<select style="font-family:'FontAwesome', Arial;" multiple="multiple"
class="form-control vacances">
<option> 1</option>
<option> 2</option>
<option> 3</option>
</select>
我注意到 Multi-select 构造函数正在添加它自己的 ul-li,它有自己的模板......所以如果我想删除选择选项计数器,我该如何自定义它 - 它搞砸了 ui
这是我的小提琴
因为原生<select>
元素是隐藏的,你看到的“选择”只是多选插件生成的<li>
/<ul>
结构,你应该为.multiselect-native-select
元素(它是一个父元素)而不是原始元素应用 CSS 规则<select>
:
.multiselect-native-select {
font-family: 'FontAwesome', 'Helvetica';
}
这是多选结构的样子:
<!-- Apply CSS rules here: -->
<span class="multiselect-native-select">
<!-- This is your original <select> element, which is hidden: -->
<select multiple="multiple" class="fontawesome-select vacances">
<option disabled="" selected="">Options</option>
<option> ZONE B</option>
...
</select>
<!-- This is the structure generated by multi-select plugin: -->
<div class="btn-group">
<button type="button" class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" title="Options" aria-expanded="false">
<span class="multiselect-selected-text">Options</span>
<b class="caret"></b>
</button>
<ul class="multiselect-container dropdown-menu">
<li class="disabled active">
<a tabindex="-1">
<label class="checkbox">
<input type="checkbox" value="Options" disabled=""> Options
</label>
</a>
</li>
<li class="disabled active">
<a tabindex="0">
<label class="checkbox">
<input type="checkbox" value=" ZONE B"> ZONE B
</label>
</a>
</li>
...
</ul>
</div>
</span>
要禁用选项计数器,您必须同时使用numberDisplayed
和allSelectedText
选项:
$('.vacances').multiselect({
numberDisplayed: 10, //number that is more or equal to number of options
allSelectedText: false
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句