首页 > 编程语言 > 详细

jquery实现鼠标拖拽排序功能

时间:2015-06-24 09:13:27      阅读:121      评论:0      收藏:0      [点我收藏+]
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Sortable - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<style>
#sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
#sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
#sortable li span { position: absolute; margin-left: -1.3em; }
</style>
<script>
$(function() {
$( "#sortable_table" ).sortable();
$( "#sortable_table" ).disableSelection();
});
</script>
</head>
<body>

<table id="sortable_table">
<tbody class="ui-state-default">
<tr>
<td>111</td>
<td>111</td>
</tr>
</tbody>
<tbody class="ui-state-default">
<tr>
<td>222</td>
<td>222</td>
</tr>
</tbody>
<tbody class="ui-state-default">
<tr>
<td>333</td>
<td>333</td>
</tr>
</tbody>
<tbody class="ui-state-default">
<tr>
<td>444</td>
<td>444</td>
</tr>
</tbody>
</table>


</body>
</html>


jquery实现鼠标拖拽排序功能

原文:http://www.cnblogs.com/shcsong/p/4596772.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!