如何取消选择 jQuery Selectable 中的元素?在这Link如何使用 jQuery Selectable 有很好的文档记录,但从未提及如何再次取消选择选定的元素。有什么想法吗?
<script>
$(function() {
$( "#selectable" ).selectable({
stop: function() {
var result = $( "#select-result" ).empty();
$( ".ui-selected", this ).each(function() {
var index = $( "#selectable li" ).index( this );
result.append( " #" + ( index + 1 ) );
});
}
});
});
</script>
<ol id="selectable">
<?php
for($i=1;$i<=9;$i++) {
echo "<li id=\"field_$i\" class=\"ui-state-default\">$i</li>";
}
?>
</ol>
最佳答案
按住 ctrl 并单击元素。它还可用于进行多项选择。
关于javascript - 如何取消选择 jQuery Selectable 中的元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24997370/