<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jquery sortable 拖动</title>
<style type="text/css">
*{box-sizing: border-box;}
.list { cursor: move; width: 300px; }
.list li { border: solid 1px #000; list-style-type: none; margin: 3px; }
</style>
<script type="text/javascript" src="http://gsycweb.eap2.net/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="http://gsycweb.eap2.net/resource/js/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function () {
$(".list").sortable({
axis: 'y',//只能竖向拖动
opacity: 0.7,// 移动时的透明度
});
});
</script>
</head>
<body>
<ul class="list">
<li id="14" title="1">
<ul class="list">
<li>1
<ul class="list">
<li>9sssss6</li>
<li>er</li>
<li>9966</li>
</ul>
</li>
<li>1</li>
<li>45</li>
</ul>
</li>
<li id="13" title="2">
<ul class="list">
<li>3</li>
<li>rt</li>
<li>3</li>
</ul>
</li>
<li id="16" title="3">
<ul class="list">
<li>2</li>
<li>567</li>
<li>2</li>
</ul>
</li>
</ul>
<hr>
<ul class="list">
<li id="14" title="1">
<ul class="list">
<li>1</li>
<li>1</li>
<li>1</li>
</ul>
</li>
<li id="13" title="2">
<ul class="list">
<li>555</li>
<li>555</li>
<li>555</li>
</ul>
</li>
<li id="16" title="3">
<ul class="list">
<li>sss</li>
<li>sss</li>
<li>sss</li>
</ul>
</li>
</ul>
</body>
</html>
jquery sortable 拖动
最新推荐文章于 2025-07-04 13:24:06 发布