1.使用场景
html,下拉列表<select>
2.使用条件
前端框架使用bootstrap
要引入jquery-ui-multiselect及其filter插件
3.需要引入的css和js
css:
bootstrap.min.css
jquery-ui.min.css
jquery.multiselect.css
jquery.multiselect.filter.css
js:
jquery.min.js
bootstrap.min.js
jquery-ui.min.js
jquery.multiselect.js
jquery.multiselect.filter.js
4.使用实例:
html:
<select class="form-control multi-select" multiple="multiple">
<option value='1'>aaa</option>
<option value='2'>bbb</option>
<option value='3'>ccc</option>
</select>
js:
<script type="text/javascript">
$('.multi-select').multiselect().multiselectfilter({
label:"input",
width:"200",
placeholder:"Please input something",
autoReset:"",
});
</script>
效果图如下:
5.资源和手册
bootsrap:http://www.bootcss.com
jquery:http://jquery.com
jquery-ui:http://jqueryui.com
jquery.multiselect:https://github.com/ehynds/jquery-ui-multiselect-widget;src文件中是js和css;demos文件中是使用实例及详细的使用介绍,其中filter.htm是filter插件的使用教程
jquery.multiselect参考手册:http://www.erichynds.com/blog/jquery-ui-multiselect-widget