首页 > Web开发 > 详细

JQueryUI-拖动(Draggable)

时间:2017-02-17 01:04:09      阅读:327      评论:0      收藏:0      [点我收藏+]

说明

允许使用鼠标移动元素


示例

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>draggable</title>
	<link rel="stylesheet" href="js/jquery-ui-1.12.1.custom/jquery-ui-1.12.1.custom/jquery-ui.min.css">
	<style>
		#draggable{
			width: 200px;
			height: 200px;
			padding: 0.5em;
			cursor: move;
		}
	</style>
</head>
<body>
	<div id="draggable" class="ui-widget-content">
		请拖动我
	</div>

	<script src="js/jquery-ui-1.12.1.custom/jquery-ui-1.12.1.custom/external/jquery/jquery.js" type="text/javascript" ></script>
	<script src="js/jquery-ui-1.12.1.custom/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
	<script>
		$("#draggable").draggable();
	</script>
</body>
</html>


输出

技术分享

技术分享

本文出自 “素颜” 博客,请务必保留此出处http://suyanzhu.blog.51cto.com/8050189/1898366

JQueryUI-拖动(Draggable)

原文:http://suyanzhu.blog.51cto.com/8050189/1898366

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