我正在處理像這樣的多電話亭http://jsfiddle.net/bDvkQ/1038/。多點觸控功能上的點擊功能
我加場 「選擇/取消所有」,並補充類 「selectAllBox」 使用此代碼:
$("label[for='Items_option_1']").addClass("selctAllBox");
$("label[for='Items_option_1']").parent().addClass("selctAllBox")
結果:
<li tabindex="-1" class="k-item selctAllBox" role="option" unselectable="on">
<input name="Items_option_1" type="checkbox" value="1">
<label class="selctAllBox" for="Items_option_1">Select/Deselect All</label>
</li>
我想,如果我選擇「全選/全部取消」複選框,所有複選框都被取消選中。我已經有一個功能可以做到這一點,但我現在無法弄清楚如何調用這個函數。我試圖做這樣的,但什麼也沒有發生:
$("label[for='Items_option_1']").parent().click(deselectSelectAll);
或
$("input[name="Items_option_1"]:checkbox").click(deselectSelectAll);
我在做什麼錯?
嘗試'$( '輸入[名稱= 「Items_option_1」]')發生變化(deselectSelectAll);' – exabyssus