【发布时间】:2018-02-02 11:37:32
【问题描述】:
我正在通过 jQuery UI 使用可排序的小部件。我能够在不使用 handle 选项的情况下让它工作。当使用handle 选项通过<button> 移动li 时,我无法让它工作。出了什么问题?
$( ".one" ).sortable({
handle: ".move"
});
$( ".two" ).sortable({});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css" />
<h1>one</h1>
<ul class="one">
<li>One <button class="move">Move</button></li>
<li>Two <button class="move">Move</button></li>
<li>Three <button class="move">Move</button></li>
<li>Four<button class="move">Move</button></li>
</ul>
<h1>two</h1>
<ul class="two">
<li>One</li>
<li>Two</li>
<li>Three</li>
<li>Four</li>
</ul>
【问题讨论】:
-
I could not get it work是什么意思?
标签: javascript jquery jquery-ui jquery-ui-sortable