OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html lang="en"> | |
3 <head> | |
4 <meta charset="UTF-8" /> | |
5 <title>jQuery UI Sortable - Connect lists</title> | |
6 <!--link type="text/css" href="development-bundle/themes/base/jquery.ui.all.
css" rel="stylesheet" /--> | |
7 <!--link type="text/css" href="development-bundle/demos/demos.css" rel="styl
esheet" /--> | |
8 <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.10.custom.css" re
l="stylesheet" /> | |
9 <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script> | |
10 <script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></scr
ipt> | |
11 <style type="text/css"> | |
12 #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; flo
at: left; margin-right: 10px; } | |
13 #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px; font-s
ize: 1.2em; width: 120px; } | |
14 </style> | |
15 <script type="text/javascript"> | |
16 $(function() { | |
17 $("#sortable1, #sortable2").sortable({ | |
18 connectWith: '.connectedSortable' | |
19 }).disableSelection(); | |
20 | |
21 var report_event = function(report_text) { | |
22 var reportElement = $("#dragging_reports"); | |
23 var origText = reportElement.text(); | |
24 reportElement.text(origText + " " + report_text); | |
25 } | |
26 | |
27 $("#sortable2").droppable({ | |
28 out: function(event, ui) { | |
29 report_event("DragOut"); | |
30 } | |
31 }); | |
32 | |
33 $("#sortable1").droppable({ | |
34 drop: function(event, ui) { | |
35 report_event("DropIn " + ui.draggable.text()); | |
36 } | |
37 }); | |
38 }); | |
39 </script> | |
40 </head> | |
41 <body> | |
42 <div class="demo"> | |
43 <ul id="sortable1" class="connectedSortable"> | |
44 <li id="leftitem-1" class="ui-state-default">LeftItem 1</li> | |
45 <li id="leftitem-2" class="ui-state-default">LeftItem 2</li> | |
46 <li id="leftitem-3" class="ui-state-default">LeftItem 3</li> | |
47 <li id="leftitem-4" class="ui-state-default">LeftItem 4</li> | |
48 <li id="leftitem-5" class="ui-state-default">LeftItem 5</li> | |
49 </ul> | |
50 | |
51 <ul id="sortable2" class="connectedSortable"> | |
52 <li id="rightitem-1" class="ui-state-highlight">RightItem 1</li> | |
53 <li id="rightitem-2" class="ui-state-highlight">RightItem 2</li> | |
54 <li id="rightitem-3" class="ui-state-highlight">RightItem 3</li> | |
55 <li id="rightitem-4" class="ui-state-highlight">RightItem 4</li> | |
56 <li id="rightitem-5" class="ui-state-highlight">RightItem 5</li> | |
57 </ul> | |
58 | |
59 </div> | |
60 | |
61 <br/> | |
62 <div class="test-data"> | |
63 <p id="dragging_reports">Nothing happened.</p> | |
64 </div> | |
65 | |
66 </body> | |
67 </html> | |
OLD | NEW |