blob: f9dd15778f0bb9aa10145db7d98113330131762f (
plain) (
blame)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="./style.css">
</head>
<body>
<div id="list1" class="list">
<div>Item 1.1
<div class="list n1">
<div>Item 2.1</div>
<div>Item 2.2
<div class="list n2">
<div>Item 3.1</div>
<div>Item 3.2</div>
<div>Item 3.3</div>
<div>Item 3.4</div>
</div>
</div>
<div>Item 2.3</div>
<div>Item 2.4</div>
</div>
</div>
<div>Item 1.2</div>
<div>Item 1.3</div>
<div>Item 1.4
<div class="list n1">
<div>Item 2.1</div>
<div>Item 2.2</div>
<div>Item 2.3</div>
<div>Item 2.4</div>
</div>
</div>
<div>Item 1.5</div>
</div>
<style>
.n1 > div {
background-color: lightblue;
}
.n2 > div {
background-color: lightgreen
}
.list {
padding: 50px;
}
</style>
<script src="../Sortable.js"></script>
<script type="text/javascript">
var elements = document.getElementsByClassName('list');
for (var i = 0; i < elements.length; i++) {
new Sortable(elements[i], {
group: 'shared',
invertSwap: true
});
}
</script>
</body>
</html>
|