0
我有一個問題與下面的腳本時,選擇的選項成爲長:精確匹配選項,OPTGROUP
解決幾個選項http://jsfiddle.net/hsQjh/5/
龍選擇與問題:http://jsfiddle.net/hsQjh/6/
我的第一個選擇框選項多達40多個選項,因此第二個選擇框最多可以選擇40個以上的選擇組,當我在f上選擇選項''時第二個盒子被填充所有編號以2開始的optgroup,它是optgroup'',''''''29'被填充,其他選項已經被選擇太。
它是否與選項的值和optgroup的標籤之間的'IDs'完全匹配?
function filterActivity(e){
var ids = $('#filterActivity + div input:checked').map(function(i) {
return $(this).val().replace(/ .*/, '');
}).get(); // Retrieve checked IDs
$('#filterSubActivity + div div label').each(function() { // Show matching options
$(this).toggle($.inArray($('input', this).val()[0], ids) > -1);
});
$('#filterSubActivity + div label.optGroup').each(function() { // Show matching groups
$(this).toggle($(this).next().find('label:visible').length > 0);
});
}
謝謝。
非常感謝你 – conmen 2013-03-26 04:25:54