5 <title>jQuery UI Sortable - Include / exclude items</title>
6 <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
7 <script src="../../jquery-1.9.1.js"></script>
8 <script src="../../ui/jquery.ui.core.js"></script>
9 <script src="../../ui/jquery.ui.widget.js"></script>
10 <script src="../../ui/jquery.ui.mouse.js"></script>
11 <script src="../../ui/jquery.ui.sortable.js"></script>
12 <link rel="stylesheet" href="../demos.css">
14 #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; zoom: 1; }
15 #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 3px; width: 90%; }
19 $( "#sortable1" ).sortable({
20 items: "li:not(.ui-state-disabled)"
23 $( "#sortable2" ).sortable({
24 cancel: ".ui-state-disabled"
27 $( "#sortable1 li, #sortable2 li" ).disableSelection();
33 <h3 class="docs">Specify which items are sortable:</h3>
36 <li class="ui-state-default">Item 1</li>
37 <li class="ui-state-default ui-state-disabled">(I'm not sortable or a drop target)</li>
38 <li class="ui-state-default ui-state-disabled">(I'm not sortable or a drop target)</li>
39 <li class="ui-state-default">Item 4</li>
42 <h3 class="docs">Cancel sorting (but keep as drop targets):</h3>
45 <li class="ui-state-default">Item 1</li>
46 <li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
47 <li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
48 <li class="ui-state-default">Item 4</li>
51 <div class="demo-description">
53 Specify which items are eligible to sort by passing a jQuery selector into
54 the <code>items</code> option. Items excluded from this option are not
55 sortable, nor are they valid targets for sortable items.
58 To only prevent sorting on certain items, pass a jQuery selector into the
59 <code>cancel</code> option. Cancelled items remain valid sort targets for