我正在禁用一些“li”可拖动元素,然后尝试根据其 id 和类启用“li”元素。该类正在被删除,但 li 元素仍然不可拖动?
//Disabling draggable on li elements using 'not'
$(".myLi:not(.disable)").sortable({
revert : true,
}).draggable({
helper : "clone"
}
});
<li id="test" class="myLi disable" >Li Point1</li>
var toTest = $('#test');
//Enabling li element to draggable again using id and class
toTest.removeClass('disable');