2016-12-30 98 views

回答

0

當列表隱藏沒有選項全選:

 $(function() { 
 
      $("#select3").multipleSelect({ 
 
       isopen: true, 
 
       multipleWidth: 55 
 
      }); 
 
      // selectAll 
 
      console.log(!$('#select3 option').length); 
 
      if(!$('#select3 option').length){ 
 
      \t   $('input[name="selectAll"]').parent().hide(); 
 
      } 
 

 
      
 
     });
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css"> 
 
<link href="https://www.jqueryscript.net/demo/jQuery-Plugin-For-Selecting-Multiple-Elements-Multiple-Select/multiple-select.css" rel="stylesheet" type="text/css"> 
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 
 
<script src="https://www.jqueryscript.net/demo/jQuery-Plugin-For-Selecting-Multiple-Elements-Multiple-Select/jquery.multiple.select.js"></script> 
 
<select id="select3" class="demo" style="width:200px;"> 
 

 
</select>

隱藏多個選擇下拉菜單:

 $(function() { 
 
      $("#select3").multipleSelect({ 
 
       isopen: true, 
 
       multipleWidth: 55 
 
      }); 
 
      $(".ms-choice").hide(); 
 
     });
<link href="https://www.jqueryscript.net/demo/jQuery-Plugin-For-Selecting-Multiple-Elements-Multiple-Select/multiple-select.css" rel="stylesheet" type="text/css"> 
 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 
 
<script src="https://www.jqueryscript.net/demo/jQuery-Plugin-For-Selecting-Multiple-Elements-Multiple-Select/jquery.multiple.select.js"></script> 
 
<select id="select3" class="demo" style="width:200px;"> 
 
<option value="1">1</option> 
 
<option value="2">2</option> 
 
<option value="3">3</option> 
 
<option value="4">4</option> 
 
<option value="5">5</option> 
 
<option value="6">6</option> 
 
<option value="7">7</option> 
 
<option value="8">8</option> 
 
<option value="9">9</option> 
 
<option value="10">10</option> 
 
<option value="11">11</option> 
 
<option value="12">12</option> 
 
<option value="13">13</option> 
 
<option value="14">14</option> 
 
<option value="15">15</option> 
 
<option value="16">16</option> 
 
<option value="17">17</option> 
 
<option value="18">18</option> 
 
<option value="19">19</option> 
 
<option value="20">20</option> 
 
<option value="21">21</option> 
 
<option value="22">22</option> 
 
<option value="23">23</option> 
 
<option value="24">24</option> 
 
<option value="25">25</option> 
 
<option value="26">26</option> 
 
<option value="27">27</option> 
 
<option value="28">28</option> 
 
<option value="29">29</option> 
 
<option value="30">30</option> 
 
<option value="31">31</option> 
 
</select>

+0

我尋找插件本身的回調函數,但仍然投票你的努力.. –

相關問題