我是Jquery的新手,我試圖按照這篇文章Jquery Example來設置,但我無法拖動我的項目。林不知道我做錯了什麼。我的代碼如下。謝謝,在DataList控件上實現jQuery可排序
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
$(function() {
$("#<%=dlProcessList.ClientID %> tbody").sortable({
handle: ".handle",
placeholder: 'ui-state-highlight',
cursor: 'move',
start: function (event, ui) {
ui.placeholder.height(ui.helper.height());
}
}).disableSelection();
});
<asp:DataList ID="dlList" runat="server" >
<HeaderTemplate>
<tbody>
</HeaderTemplate>
<ItemTemplate>
// My Data to display
</ItemTemplate>
<FooterTemplate>
</tbody>
</FooterTemplate>
</asp:DataList>
你收到任何JavaScript錯誤? – zgood
沒有,當我看着螢火蟲(控制檯窗口)我沒有得到任何錯誤。我想我可能會附加到錯誤的父項。 $(「#<%= dlProcessList.ClientID%> tbody」)。sortable({ – Princess