-
Notifications
You must be signed in to change notification settings - Fork 0
/
dragdrop.html
107 lines (97 loc) · 4.09 KB
/
dragdrop.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LearnAutomatedTestingDemoPage</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div id="navigation"></div>
<main role="main">
<div class="container">
<div class="row mt-4">
<div class="col">
<div class="jumbotron">
<h1>Drag and Drop items for Bootstrap 4 - Advanced Components</h1>
<p class="lead">by djibe.</p>
<p class="text-muted">(thx to BS4 + Daemonite Material Design + Sortable.js)</p>
<p>
Plugin for BS4 to be able to drag and drop elements with the screen. <a href="https://github.com/RubaXa/Sortable" target="_blank">Sortable.js</a> does all the job without jQuery.
</p>
<h2>
Tutorial
</h2>
<ol>
<li>Add this lines to your html, below boostrap.bundle.js<br>
<code><script src="https://cdn.jsdelivr.net/gh/RubaXa/Sortable/Sortable.min.js"></code>
</li>
<li>
Initialize Sortable<br>
<code>
Sortable.create(demo1, {
animation: 100,
group: 'list-1',
draggable: '.list-group-item',
handle: '.list-group-item',
sort: true,
filter: '.sortable-disabled',
chosenClass: 'active'
});
</code>
</li>
<li><a href="https://github.com/RubaXa/Sortable" target="_blank">Read full documentation</a></li>
</ol>
<h2>
Demo
</h2>
<p>
Try to drag and drop items within lists or between lists.
</p>
<ul class="list-group" id="demo1">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
<ul class="list-group mt-4" id="demo2">
<li class="list-group-item">Cras justo odio</li>
<li class="list-group-item">Dapibus ac facilisis in</li>
<li class="list-group-item">Morbi leo risus</li>
<li class="list-group-item">Porta ac consectetur ac</li>
<li class="list-group-item">Vestibulum at eros</li>
</ul>
</div>
</div>
</div>
</div>
</main>
<footer class="container">
<p>©2020</p>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(function() {
$("#navigation").load("navigation.html");
});
Sortable.create(demo1, {
animation: 100,
group: 'list-1',
draggable: '.list-group-item',
handle: '.list-group-item',
sort: true,
filter: '.sortable-disabled',
chosenClass: 'active'
});
Sortable.create(demo2, {
group: 'list-1',
handle: '.list-group-item'
});
</script>
</body>
</html>