1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
5 <title>script.aculo.us sortable functional test file
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <script type=
"text/javascript" src=
"../../MochiKit/MochiKit.js"></script>
8 <script type=
"text/javascript" src=
"../../MochiKit/Position.js"></script>
9 <script type=
"text/javascript" src=
"../../MochiKit/Visual.js"></script>
10 <script type=
"text/javascript" src=
"../../MochiKit/Signal.js"></script>
11 <script type=
"text/javascript" src=
"../../MochiKit/DragAndDrop.js"></script>
12 <script type=
"text/javascript" src=
"../../MochiKit/Sortable.js"></script>
13 <style type=
"text/css" media=
"screen">
15 list-style-image:none;
28 background-color: #E8A400;
34 background-color: #ECF3E1;
35 border:
1px solid #C5DEA1;
40 border:
1px solid #E8A400;
41 background-color: #FFF4D8;
46 <h1>script.aculo.us: Two floating sortables with containment and dropOnEmpty
</h1>
48 <div style=
"height:200px;">
49 <div style=
"float:left;">
50 <h3>This is the first list
</h3>
51 <ul class=
"sortabledemo" id=
"firstlist" style=
"height:150px;width:200px;">
52 <li class=
"green" id=
"firstlist_firstlist1">Item
1 from first list.
</li>
53 <li class=
"green" id=
"firstlist_firstlist2">Item
2 from first list.
</li>
54 <li class=
"green" id=
"firstlist_firstlist3">Item
3 from first list.
</li>
57 <div style=
"float:left;">
58 <h3>And now the second list
</h3>
59 <ul class=
"sortabledemo" id=
"secondlist" style=
"height:150px;width:200px;">
60 <li class=
"orange" id=
"secondlist_secondlist1">
61 <span class=
"handle">DRAG HERE
</span> Item
1 from second list.
63 <li class=
"orange" id=
"secondlist_secondlist2">
64 <span class=
"handle">DRAG HERE
</span> Item
2 from second list.
66 <li class=
"orange" id=
"secondlist_secondlist3">
67 <span class=
"handle">DRAG HERE
</span> Item
3 from second list.
73 <hr style=
"clear:both" />
75 <pre id=
"firstlist_debug"></pre>
76 <pre id=
"secondlist_debug"></pre>
78 <script type=
"text/javascript">
80 MochiKit.Sortable.Sortable.create(
"firstlist",
81 {dropOnEmpty:true,containment:[
"firstlist",
"secondlist"],constraint:false,
82 onChange:function(){$('firstlist_debug').innerHTML = MochiKit.Sortable.Sortable.serialize('firstlist') }});
83 MochiKit.Sortable.Sortable.create(
"secondlist",
84 {dropOnEmpty:true,handle:'handle',containment:[
"firstlist",
"secondlist"],constraint:false,
85 onChange:function(){$('secondlist_debug').innerHTML = MochiKit.Sortable.Sortable.serialize('secondlist') }});