jQuery UI Selectable - unselect selected item on click

前端 未结 4 1834
南方客
南方客 2020-12-24 15:24

Does anyone know if there\'s a way to configure a jquery ui selectable element to unselect the selected element when you click it? Sort of like a toggle. If it\'s already

4条回答
  •  粉色の甜心
    2020-12-24 16:03

    i'm very late in responding to your question, but let me just answer it anyway so that to keep it as a reference for others.

    $( ".selector" ).bind( "mousedown", function ( e ) {
        e.metaKey = true;
    } ).selectable();
    

    this will allow the toggle behavior that you're looking for.

提交回复
热议问题