Bootstrap 3 下拉选框 select boxes

1. Select 2

Selection_057

Browser compatibility

  • IE 8+
  • Chrome 8+
  • Firefox 10+
  • Safari 3+
  • Opera 10.6+
    $(document).ready(function() {
      $(".js-example-basic-single").select2();
    });
     
    <select class="js-example-basic-single">
      <option value="AL">Alabama</option>
        ...
      <option value="WY">Wyoming</option>
    </select>

下载:select2-master

更多实例参考:https://select2.github.io/examples.html

2. bootstrap-select

Selection_060

// To style only <select>s with the selectpicker class
$('.selectpicker').selectpicker();

//Or
// To style all <select>s
$('select').selectpicker();
<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>

下载:bootstrap-select-master

更多实例参考:https://silviomoreto.github.io/bootstrap-select/examples/

 

本文:Bootstrap 3 下拉选框 select boxes

Leave a Reply