forked from farhadi/html5sortable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
176 lines (175 loc) · 4.03 KB
/
index.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!doctype html>
<head>
<meta charset="utf-8">
<title>HTML5 Sortable jQuery Plugin</title>
<style>
header, section {
display: block;
}
body {
font-family: 'Droid Serif';
}
h1, h2 {
text-align: center;
font-weight: normal;
}
#features {
margin: auto;
width: 460px;
font-size: 0.9em;
}
.connected, .sortable, .exclude, .handles {
margin: auto;
padding: 0;
width: 310px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.sortable.grid {
overflow: hidden;
}
.connected li, .sortable li, .exclude li, .handles li {
list-style: none;
border: 1px solid #CCC;
background: #F6F6F6;
font-family: "Tahoma";
color: #1C94C4;
margin: 5px;
padding: 5px;
height: 22px;
}
.handles span {
cursor: move;
}
li.disabled {
opacity: 0.5;
}
.sortable.grid li {
line-height: 80px;
float: left;
width: 80px;
height: 80px;
text-align: center;
}
li.highlight {
background: #FEE25F;
}
#connected {
width: 440px;
overflow: hidden;
margin: auto;
}
.connected {
float: left;
width: 200px;
}
.connected.no2 {
float: right;
}
li.sortable-placeholder {
border: 1px dashed #CCC;
background: none;
}
</style>
<link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css'>
</head>
<body>
<header>
<h1>HTML5 Sortable jQuery Plugin</h1>
</header>
<section>
<h2>Features</h2>
<ul id="features">
<li>Less than 1KB (minified).
<li>Built using native HTML5 drag and drop API.</li>
<li>Supports both list and grid style layouts.</li>
<li>Similar API and behaviour to jquery-ui sortable plugin.</li>
<li>Works in IE 5.5+, Firefox 3.5+, Chrome 3+, Safari 3+ and, Opera 12+.</li>
</ul>
</section>
<section>
<h2>Sortable List</h2>
<ul class="sortable list">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>
</section>
<section>
<h2>Sortable Grid</h2>
<ul class="sortable grid">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>
</section>
<section>
<h2>Exclude Items</h2>
<ul class="exclude list">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li class="disabled">Item 4</li>
<li class="disabled">Item 5</li>
<li class="disabled">Item 6</li>
</ul>
</section>
<section>
<h2>Sortable List With Handles</h2>
<ul class="handles list">
<li><span>::</span> Item 1</li>
<li><span>::</span> Item 2</li>
<li><span>::</span> Item 3</li>
<li><span>::</span> Item 4</li>
<li><span>::</span> Item 5</li>
<li><span>::</span> Item 6</li>
</ul>
</section>
<section id="connected">
<h2>Connected Sortable Lists</h2>
<ul class="connected list">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>
<ul class="connected list no2">
<li class="highlight">Item 1</li>
<li class="highlight">Item 2</li>
<li class="highlight">Item 3</li>
<li class="highlight">Item 4</li>
<li class="highlight">Item 5</li>
<li class="highlight">Item 6</li>
</ul>
</section>
<a href="http://github.com/farhadi/html5sortable"><img style="position: absolute; top: 0; left: 0; border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/edc6dae7a1079163caf7f17c60495bbb6d027c93/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f6c6566745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub"></a>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="jquery.sortable.js"></script>
<script>
$(function() {
$('.sortable').sortable();
$('.handles').sortable({
handle: 'span'
});
$('.connected').sortable({
connectWith: '.connected'
});
$('.exclude').sortable({
items: ':not(.disabled)'
});
});
</script>
</body>
</html>