1. Select 2
Browser compatibility
- IE 8+
- Chrome 8+
- Firefox 10+
- Safari 3+
- Opera 10.6+
<script>
$(document).ready(function() {
$(".js-example-basic-single").select2();
});
</script>
<select class="js-example-basic-single">
<option value="AL">Alabama</option>
...
<option value="WY">Wyoming</option>
</select>
更多实例参考:https://select2.github.io/examples.html
2. bootstrap-select
<script>
$(function(){
// To style only <select>s with the selectpicker class
$('.selectpicker').selectpicker();
//Or
// To style all <select>s
$('select').selectpicker();
})
</script>
<select class="selectpicker" data-live-search="true">
<option data-tokens="ketchup mustard">Hot Dog, Fries and a Soda</option>
<option data-tokens="mustard">Burger, Shake and a Smile</option>
<option data-tokens="frosting">Sugar, Spice and all things nice</option>
</select>
更多实例参考:https://silviomoreto.github.io/bootstrap-select/examples/
原文/转自:Bootstrap 3 下拉选框 select boxes
本文介绍了Bootstrap 3中两种下拉选框的实现方式:Select2和bootstrap-select。Select2浏览器兼容性包括IE 8+、Chrome 8+等,提供了下载链接和更多实例参考。而bootstrap-select也有相应的下载资源和示例参考。


910

被折叠的 条评论
为什么被折叠?



