-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
64 lines (64 loc) · 1.61 KB
/
index.html
File metadata and controls
64 lines (64 loc) · 1.61 KB
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ngDraggable Scroll Problem</title>
<style>
body {
font-family: Verdana, Arial, sans-serif;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
div.container {
margin: 5px;
padding: 5px;
background-color: linen;
}
div.dropzone {
background-color: orange;
color: maroon;
margin: 5px;
padding: 20px;
text-align: center;
width: 150px;
}
div.dragitem {
background-color: dodgerblue;
color: darkblue;
margin: 5px;
padding: 20px;
text-align: center;
width: 150px;
}
</style>
<script src="jquery.js"></script>
<script src="angular.js"></script>
<script src="ngDraggable.js"></script>
<script>
angular.module('myApp', ['ngDraggable'])
.controller('MainController', function($scope) {
$scope.ids = [];
for (var i = 0; i < 20; i++) {
$scope.ids.push('id-' + i);
}
$scope.onDropComplete = function(id, $data, $event) {
console.log('item dropped on ' + id);
}
});
</script>
</head>
<body ng-app="myApp" ng-controller="MainController">
<div class="container">
<div class="dropzone" id="{{id}}" ng-repeat="id in ids" ng-drop="true" ng-drop-success="onDropComplete(id, $data, $event)">
id: {{id}}
</div>
<div class="dragitem" ng-drag="true">
dragme
</div>
</div>
</body>
</html>