JQueryUI-拖动(Draggable)

简介:

说明

允许使用鼠标移动元素


示例

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

本文转自 素颜猪 51CTO博客,原文链接:http://blog.51cto.com/suyanzhu/1898366


相关文章
|
10月前
|
数据处理 C# UED
42.c#:progressbar控件
42.c#:progressbar控件
141 1
51zTree - 右键菜单的实现
51zTree - 右键菜单的实现
77 1
QTableView左上角背景色样式表
QTableView左上角背景色样式表
102 0
|
Android开发 UED
好看的Dialog加载动画
好看的Dialog加载动画
Datagrid添加右键菜单
Datagrid添加右键菜单
106 0
|
前端开发
CSS 鼠标样式和手指样式
巧合要用到鼠标样式效果,就顺便整理了下十五种CSS鼠标样式,小例子供大家使用啊。CSS鼠标样式语法如下: 任意标签中插入 style="cursor:*"   例 子:&lt;span style="cursor:*"&gt;文本或其它页面元素&lt;/span&gt;  &lt;a href="#" style="cursor:*"&gt;文本或其它页面元素&lt;/a&gt;
1956 0
|
JavaScript 前端开发
关于弹出层的总结
关于弹出层的我的做法: 例如:点击“修改”按钮,弹出弹出框,并将需要修改的信息附到弹出框中; 思路: 1. 点击修改按钮,弹出阴影遮罩,阴影遮罩的样式代码如下:
127 0
CSS3鼠标滑过图片3D旋转动画
在线演示       本地下载
1119 0