5 <title>jQuery UI Sortable - Drop placeholder</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 #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
15 #sortable li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; height: 1.5em; }
16 html>body #sortable li { height: 1.5em; line-height: 1.2em; }
17 .ui-state-highlight { height: 1.5em; line-height: 1.2em; }
21 $( "#sortable" ).sortable({
22 placeholder: "ui-state-highlight"
24 $( "#sortable" ).disableSelection();
31 <li class="ui-state-default">Item 1</li>
32 <li class="ui-state-default">Item 2</li>
33 <li class="ui-state-default">Item 3</li>
34 <li class="ui-state-default">Item 4</li>
35 <li class="ui-state-default">Item 5</li>
36 <li class="ui-state-default">Item 6</li>
37 <li class="ui-state-default">Item 7</li>
40 <div class="demo-description">
42 When dragging a sortable item to a new location, other items will make room
43 for the that item by shifting to allow white space between them. Pass a
44 class into the <code>placeholder</code> option to style that space to
45 be visible. Use the boolean <code>forcePlaceholderSize</code> option
46 to set dimensions on the placeholder.