如何使用Shift +单击列表中的jquery(jscript)实现多项选择:
<div class="custom-multi-select-option">
<span class="custom-multi-select-option-label">Tollet</span>
</div>
<div class="custom-multi-select-option">
<span class="custom-multi-select-option-label">Present</span>
</div>
通过添加简单选择工具
toggleClass( "custom-multi-select-option-selected" );
我试试这个,但它没有正常工作:
var _onClickOnCustomMultiSelect = function( e ){
$( this ).toggleClass( "custom-multi-select-option-selected" );
$( this ).find(".custom-multi-select-option-label").toggleClass( "custom-multi-select-option-selected" );
if(e.shiftKey) {
$('div.custom-multi-select-option-selected').nextUntil(this).toggleClass( "custom-multi-select-option-selected" );
}
};