首页>>表单>>jQuery多选下拉框插件(2022-02-08)

jQuery多选下拉框插件

jQuery多选下拉框插件
赞赏支持
立刻微信赞赏支持 关闭

 

XML/HTML Code
  1. <form class="demo-example">  
  2.             <label for="people">Select people:</label>  
  3.             <select id="people" name="people" multiple>  
  4.                 <option value="alice">Alice</option>  
  5.                 <option value="bob">Bob</option>  
  6.                 <option value="carol">Carol</option>  
  7.             </select>  
  8.         </form>  

 

JavaScript Code
  1. <script type="text/javascript">  
  2.     $(function(){  
  3.         $('#people').multiSelect();  
  4.         $('#line-wrap-example').multiSelect({  
  5.             positionMenuWithin: $('.position-menu-within')  
  6.         });  
  7.         $('#categories').multiSelect({  
  8.             noneText: 'All categories',  
  9.             presets: [  
  10.                 {  
  11.                     name: 'All categories',  
  12.                     options: []  
  13.                 },  
  14.                 {  
  15.                     name: 'My categories',  
  16.                     options: ['a''c']  
  17.                 }  
  18.             ]  
  19.         });  
  20.         $('#modal-example').multiSelect({  
  21.             'modalHTML''<div class="multi-select-modal">'  
  22.         });  
  23.     });  
  24.     </script>  

 


原文地址:http://www.freejs.net/article_biaodan_930.html