Chosen is a Select drop-down box that supports jquery to make the ugly, long select box look better and more convenient. Not only that, it expands the Select, adding the ability to automatically filter. It can group lists, and it can also disable certain selections.
First look at the effect of the plugin:
Let's take a look at its usage.
Introducing Core Files
1 <Linkrel= "stylesheet"href= "Docsupport/style.css">2 <Linkrel= "stylesheet"href= "Docsupport/prism.css">3 <Linkrel= "stylesheet"href= "Chosen.css">4 <Scriptsrc= "Jquery-1.6.min.js"type= "Text/javascript"></Script>5 <Scriptsrc= "Chosen.jquery.js"type= "Text/javascript"></Script>6 <Scriptsrc= "Docsupport/prism.js"type= "Text/javascript"CharSet= "Utf-8"></Script>
Building HTML
1 <SelectData-placeholder= "Choose a country ..."class= "Chosen-select"style= "width:350px;"TabIndex= "2">2 <optionvalue=""></option>3 <optionvalue= "states">States</option>4 <optionvalue= "Kingdom">Kingdom</option>5 <optionvalue= "Afghanistan">Afghanistan</option>6 <optionvalue= "Aland Islands">Aland Islands</option>7 <optionvalue= "Albania">Albania</option>8 <optionvalue= "New Caledonia">New Caledonia</option>9 <optionvalue= "New Zealand">New Zealand</option>Ten <optionvalue= "Nicaragua">Nicaragua</option> One <optionvalue= "Niger">Niger</option> A <optionvalue= "Nigeria">Nigeria</option> - <optionvalue= "Niue">Niue</option> - <optionvalue= "Norfolk Island">Norfolk Island</option> the <optionvalue= "Northern Mariana Islands">Northern Mariana Islands</option> - <optionvalue= "Norway">Norway</option> - <optionvalue= "Oman">Oman</option> - <optionvalue= "Pakistan">Pakistan</option> + <optionvalue= "Palau">Palau</option> - <optionvalue= "Palestinian Territory, occupied">Palestinian Territory, occupied</option> + <optionvalue= "Panama">Panama</option> A <optionvalue= "Papua New Guinea">Papua New Guinea</option> at <optionvalue= "Paraguay">Paraguay</option> - <optionvalue= "Peru">Peru</option> - <optionvalue= "Philippines">Philippines</option> - <optionvalue= "Pitcairn">Pitcairn</option> - <optionvalue= "Poland">Poland</option> - <optionvalue= "Portugal">Portugal</option> in <optionvalue= "Zambia">Zambia</option> - <optionvalue= "Zimbabwe">Zimbabwe</option> to </Select>
Write JS, implementation of the drop-down landscaping and filtering functions, here is the default, no parameters, more please refer to the example.
$ (". Chosen-select"). Chosen ();
: Baidu Cloud | Official Downloads
jquery drop-down box extension and landscaping plugin chosen