兼容ie7的列表拖拽+排序(jqueryUI)

参考:

官网:添加链接描述
相关配置参数:添加链接描述

代码:
<!doctype html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>jQuery UI Draggable + Sortable</title>
		<link rel="stylesheet" href="/resources/demos/style.css">
		<style>
			.cols-list{
				width: 700px;
				list-style-type: none;
				margin: 0;
				padding: 0;
				margin-bottom: 10px;
				min-height: 50px;
				background: #e0eefb;
				padding: 10px 0;
			}
			
			li {
				width: 95%;
				margin: 5px;
				padding: 5px;
				cursor: move;
				border: 1px solid #ccc;
				background: #fff;
			}

		</style>
		<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
		<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
		<script>
			$(function() {
				$(".cols-list").sortable({
					axis: 'y', //限制移动的方向
					items: ".col", //指定移动的元素
					connectWith: '.cols-list' //指定在哪些区域内移动
				});
			});
		</script>
	</head>
	<body>
		<ul class="cols-list">
			<li class="col">Item 1</li>
			<li class="col">Item 2</li>
			<li class="col">Item 3</li>
			<li class="col">Item 4</li>
			<li class="col">Item 5</li>
		</ul>
		<ul class="cols-list">
	
		</ul>
	</body>

</html>
最终效果:

可以在ie7下不同区域间拖拽排序
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值