说明

允许使用鼠标移动元素


示例

<!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>


输出

wKiom1ilGT2gqARMAAAkLKG9nmY606.png-wh_50

wKioL1ilGWOBInjaAAAndecjK-c822.png-wh_50