-
Notifications
You must be signed in to change notification settings - Fork 2
/
sample03.html
51 lines (49 loc) · 1.4 KB
/
sample03.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>drag and drop | jQuery JavaScript</title>
</head>
<body>
<style>
body {
margin: 10px;
}
#listWithHandle div {
float: left;
margin-left: 5px;
width: 100px;
height: 100px;
border: 1px solid #00A5E3;
font-size: 24px;
text-align: center;
}
.icon-move {
cursor: move;
cursor: -webkit-grabbing;
}
</style>
<div id="listWithHandle">
<div><span class="icon-move" aria-hidden="true">#</span>01</div>
<div><span class="icon-move" aria-hidden="true">#</span>02</div>
<div><span class="icon-move" aria-hidden="true">#</span>03</div>
<div><span class="icon-move" aria-hidden="true">#</span>04</div>
<div><span class="icon-move" aria-hidden="true">#</span>05</div>
<div><span class="icon-move" aria-hidden="true">#</span>06</div>
<div><span class="icon-move" aria-hidden="true">#</span>07</div>
<div><span class="icon-move" aria-hidden="true">#</span>08</div>
<div><span class="icon-move" aria-hidden="true">#</span>09</div>
</div>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="js/Sortable/Sortable.min.js"></script>
<script>
$(function(){
Sortable.create(listWithHandle, {
handle: '.icon-move',
animation: 150,
});
});
</script>
</body>
</html>