码迷,mamicode.com
首页 > 编程语言 > 详细

jquery实现鼠标拖拽排序功能

时间:2015-06-24 09:16:08      阅读:143      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!