1 | <!doctype html>
|
---|
2 | <html lang="en">
|
---|
3 | <head>
|
---|
4 | <title>jQuery UI Sortable - Drop placeholder</title>
|
---|
5 | <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet" />
|
---|
6 | <script type="text/javascript" src="../../jquery-1.4.1.js"></script>
|
---|
7 | <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
|
---|
8 | <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
|
---|
9 | <script type="text/javascript" src="../../ui/jquery.ui.mouse.js"></script>
|
---|
10 | <script type="text/javascript" src="../../ui/jquery.ui.sortable.js"></script>
|
---|
11 | <link type="text/css" href="../demos.css" rel="stylesheet" />
|
---|
12 | <style type="text/css">
|
---|
13 | #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
|
---|
14 | #sortable li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; height: 1.5em; }
|
---|
15 | html>body #sortable li { height: 1.5em; line-height: 1.2em; }
|
---|
16 | .ui-state-highlight { height: 1.5em; line-height: 1.2em; }
|
---|
17 | </style>
|
---|
18 | <script type="text/javascript">
|
---|
19 | $(function() {
|
---|
20 | $("#sortable").sortable({
|
---|
21 | placeholder: 'ui-state-highlight'
|
---|
22 | });
|
---|
23 | $("#sortable").disableSelection();
|
---|
24 | });
|
---|
25 | </script>
|
---|
26 | </head>
|
---|
27 | <body>
|
---|
28 | <div class="demo">
|
---|
29 |
|
---|
30 | <ul id="sortable">
|
---|
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>
|
---|
38 | </ul>
|
---|
39 |
|
---|
40 | </div><!-- End demo -->
|
---|
41 |
|
---|
42 | <div class="demo-description">
|
---|
43 |
|
---|
44 | <p>
|
---|
45 | When dragging a sortable item to a new location, other items will make room
|
---|
46 | for the that item by shifting to allow white space between them. Pass a
|
---|
47 | class into the <code>placeholder</code> option to style that space to
|
---|
48 | be visible. Use the boolean <code>forcePlaceholderSize</code> option
|
---|
49 | to set dimensions on the placeholder.
|
---|
50 | </p>
|
---|
51 |
|
---|
52 | </div><!-- End demo-description -->
|
---|
53 |
|
---|
54 | </body>
|
---|
55 | </html>
|
---|