jQuery select下拉框单选和多选插件
js代码
$('.form-control-chosen').chosen({
allow_single_deselect: true,
width: '100%'
});
$('.form-control-chosen-required').chosen({
allow_single_deselect: false,
width: '100%'
});
$('.form-control-chosen-search-threshold-100').chosen({
allow_single_deselect: true,
disable_search_threshold: 100,
width: '100%'
});
$('.form-control-chosen-optgroup').chosen({
width: '100%'
});
$(function() {
$('[title="clickable_optgroup"]').addClass('chosen-container-optgroup-clickable');
});
$(document).on('click', '[title="clickable_optgroup"] .group-result', function() {
var unselected = $(this).nextUntil('.group-result').not('.result-selected');
if(unselected.length) {
unselected.trigger('mouseup');
} else {
$(this).nextUntil('.group-result').each(function() {
$('a.search-choice-close[data-option-array-index="' + $(this).data('option-array-index') + '"]').trigger('click');
});
}
});
申明:php中文网下载站匠心打造专业的IT资源下载站!一切资源免费,来源网络收集,请自行检测软件的完整性。交流QQ群:916808767