多个选择班次+从列表中单击

时间:2016-11-23 19:55:39

标签: javascript jquery

如何使用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>

List on form

通过添加简单选择工具 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" );
    }
};

0 个答案:

没有答案