-
Notifications
You must be signed in to change notification settings - Fork 19
/
.tmp_dragndrop.html.85721~
136 lines (115 loc) · 3.13 KB
/
.tmp_dragndrop.html.85721~
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Simple Agile Planning Board</title>
<style>
body
{
font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
}
#board
{
width: 910px;
min-height:100px;
position:relative;
}
.title
{
background-color:#52460a;
text-align:center;
color:white;
padding: 2px 0px;
}
#inprogress
{
left:302px;
}
#done
{
left:604px;
}
#todo, #inprogress, #done
{
background-color: tan;
position:absolute;
width: 300px;
min-height:150px;
border: 2px solid black;
}
*[draggable=true]
{
float:left;
min-width: 50px;
min-height: 50px;
border: 2px solid black;
margin: 10px;
font-weight:bold;
min-height:60px;
background-image: -webkit-gradient(linear,
left top, left bottom,
color-stop(0.63, white),
color-stop(0.92, rgb(5,161,245)));
background-image:-moz-linear-gradient(
center top,
white 63%,
rgb(5,161,245) 92%
);
-webkit-background-size:1px 8px;
-moz-background-size:1px 8px;
background-size:1px 8px;
background-repeat:repeat;
}
.cardTitle
{
background-color: rgb(255,255,255);
border:2px solid white;
}
</style>
<body>
<div id="board">
<div id="todo">
<div class="title">To Do</div>
<div id="item1" draggable="true">
<div class="cardTitle">
Learn HTML5
</div>
</div>
<div id="item2" draggable="true">
<div class="cardTitle">
Learn CSS3
</div>
</div>
<!--<div id="item3" draggable="true">Make an amazing site</div>
<div id="item4" draggable="true">Impress my friends</div>-->
</div>
<div id="inprogress">
<div class="title">In Progress</div>
</div>
<div id="done">
<div class="title">Done</div>
</div>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js">
</script>
<script type="text/javascript">
$('document').ready(init);
function init(){
$('#item1, #item2').bind('dragstart', function(event) {
event.originalEvent.dataTransfer.setData("text/plain", event.target.getAttribute('id'));
});
// bind the dragover event on the board sections
$('#todo, #inprogress, #done').bind('dragover', function(event) {
event.preventDefault();
});
// bind the drop event on the board sections
$('#todo, #inprogress, #done').bind('drop', function(event) {
var notecard = event.originalEvent.dataTransfer.getData("text/plain");
event.target.appendChild(document.getElementById(notecard));
// Turn off the default behaviour
// without this, FF will try and go to a URL with your id's name
event.preventDefault();
});
}
</script>
</body>
</html>