annotate jquery-ui/development-bundle/demos/sortable/items.html @ 51:5d636ba6b9cb default tip

Merge with b5d89c03f9585013d464f0240f6d82751b77186f
author dwinter
date Thu, 05 Dec 2013 13:24:57 +0100
parents b2e4605f20b2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
1 <!DOCTYPE html>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
2 <html lang="en">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
3 <head>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
4 <meta charset="utf-8">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
5 <title>jQuery UI Sortable - Include / exclude items</title>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
6 <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
7 <script src="../../jquery-1.5.1.js"></script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
8 <script src="../../ui/jquery.ui.core.js"></script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
9 <script src="../../ui/jquery.ui.widget.js"></script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
10 <script src="../../ui/jquery.ui.mouse.js"></script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
11 <script src="../../ui/jquery.ui.sortable.js"></script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
12 <link rel="stylesheet" href="../demos.css">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
13 <style>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
14 #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; zoom: 1; }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
15 #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 3px; width: 90%; }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
16 </style>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
17 <script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
18 $(function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
19 $( "#sortable1" ).sortable({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
20 items: "li:not(.ui-state-disabled)"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
21 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
22
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
23 $( "#sortable2" ).sortable({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
24 cancel: ".ui-state-disabled"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
25 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
26
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
27 $( "#sortable1 li, #sortable2 li" ).disableSelection();
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
28 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
29 </script>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
30 </head>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
31 <body>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
32 <div class="demo">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
33
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
34 <h3 class="docs">Specify which items are sortable:</h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
35
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
36 <ul id="sortable1">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
37 <li class="ui-state-default">Item 1</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
38 <li class="ui-state-default ui-state-disabled">(I'm not sortable or a drop target)</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
39 <li class="ui-state-default ui-state-disabled">(I'm not sortable or a drop target)</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
40 <li class="ui-state-default">Item 4</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
41 </ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
42
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
43 <h3 class="docs">Cancel sorting (but keep as drop targets):</h3>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
44
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
45 <ul id="sortable2">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
46 <li class="ui-state-default">Item 1</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
47 <li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
48 <li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
49 <li class="ui-state-default">Item 4</li>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
50 </ul>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
51
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
52 </div><!-- End demo -->
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
53
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
54
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
55
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
56 <div class="demo-description">
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
57 <p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
58 Specify which items are eligible to sort by passing a jQuery selector into
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
59 the <code>items</code> option. Items excluded from this option are not
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
60 sortable, nor are they valid targets for sortable items.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
61 </p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
62 <p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
63 To only prevent sorting on certain items, pass a jQuery selector into the
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
64 <code>cancel</code> option. Cancelled items remain valid sort targets for
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
65 others.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
66 </p>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
67 </div><!-- End demo-description -->
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
68
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
69 </body>
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
70 </html>