-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmobiledragdrop.html
118 lines (109 loc) · 3.79 KB
/
mobiledragdrop.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
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
<title>Mobile Drag And Drop Example</title>
<link rel="stylesheet" type="text/css" href="optional.css">
<style type="text/css">
/* Recommended styles */
.drag, .drag2 {
float: left;
width: 21%;
background-color: Green;
color: White;
margin: 10px 2%;
cursor: move;
text-align: center;
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
border-radius: 1em;
}
.selected {
background-color: Yellow;
color: Black;
}
.drop {
background-color: Blue;
color: White;
margin: 3px;
padding: 10px;
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
border-radius: 1em;
}
.active {
background-color: orange;
cursor: crosshair;
}
</style>
</head>
<body>
<div id="links">
<p>This is the live demo, <a href="http://www.stevefenton.co.uk/Content/Jquery-Mobile-Drag-And-Drop-Example/">view the documentation</a>.
Written by <a href="http://www.stevefenton.co.uk/">Steve Fenton</a>.</p>
</div>
<div id="header">
<h1>Mobile Drag And Drop Example</h1>
</div>
<div id="maincontent">
<div id="what">
<h2>Mobile Drag And Drop Summary</h2>
<p>The jQuery Mobile Drag And Drop project is a plugin provides drag-and-drop functionality that works on desktop browsers as well as touch-screen mobile
devices.</p>
<p>Using a desktop browser, you can fully utilise the drag-and-drop. On a mobile browser, there is a fall-back tap-to-life and tap-to-drop behaviour.</p>
<p>Note: The 4th draggable item can only be placed in the second drop zone - this is an example that shows how each draggable item can be given different drop zones.</p>
</div>
<div id="how">
<div class="drop" id="drop1">
<div style="clear: both;"><p>You can drop items here.</p></div>
</div>
<div class="drop" id="drop2">
<div style="clear: both;"><p>You can drop items here too.</p></div>
</div>
<div class="drag" id="drag1">
<p>Drag 1</p>
</div>
<div class="drag" id="drag2">
<p>Drag 2</p>
</div>
<div class="drag" id="drag3">
<p>Drag 3</p>
</div>
<div class="drag2" id="drag4">
<p>Drag 4*</p>
</div>
<div style="clear: both"> </div>
<p>Please <a href="http://www.stevefenton.co.uk/Content/Jquery-Constant-Footer/">read the mobile drag and drop documentation</a>
for instructions on how to use the plugin.</p>
</div>
<div id="options">
<h2>Options</h2>
<dl>
<dt>classmodifier</dt>
<dd>Used to apply class names to the elements created by the plugin. You only need to specify a class modifier if you have a name-clash.</dd>
<dt>targets</dt>
<dd>The jQuery selector of the element or elements that you can drop an item onto (otherwise known as "drop zones").</dd>
<dt>status</dt>
<dd>The jQuery selector for an element, into which the current status of dragging and dropping will be placed. This is handy for testing purposes!</dd>
<dt>selectedclass</dt>
<dd>The class to be applied to draggable items when they are picked up.</dd>
<dt>activeclass</dt>
<dd>The class to be applied to "drop zones" when a draggable item is picked up.</dd>
</dl>
</div>
</div>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.mobiledragdrop.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".drag").mobiledraganddrop({ targets: ".drop", status: "#status"});
$(".drag2").mobiledraganddrop({ targets: "#drop2", status: "#status"});
});
</script>
<!-- Just for web stats... not needed for the plugin -->
<script type="text/javascript">
var myMasterUri = "http://www.stevefenton.co.uk/";
var myStatUrl = "http://www.stevefenton.co.uk/reports/";
</script>
<script type="text/javascript" src="/reports/swiftstats.js"></script>
</body>
</html>