48f7a67a4da0e168062d5652f40c2b2ed48a69c0
[matches/MCTX3420.git] /
1 <!doctype html>
2 <html lang="en">
3 <head>
4         <meta charset="utf-8">
5         <title>jQuery UI Sortable - Connect lists with Tabs</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         <script src="../../ui/jquery.ui.droppable.js"></script>
13         <script src="../../ui/jquery.ui.tabs.js"></script>
14         <link rel="stylesheet" href="../demos.css">
15         <style>
16         #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 120px; }
17         </style>
18         <script>
19         $(function() {
20                 $( "#sortable1, #sortable2" ).sortable().disableSelection();
21
22                 var $tabs = $( "#tabs" ).tabs();
23
24                 var $tab_items = $( "ul:first li", $tabs ).droppable({
25                         accept: ".connectedSortable li",
26                         hoverClass: "ui-state-hover",
27                         drop: function( event, ui ) {
28                                 var $item = $( this );
29                                 var $list = $( $item.find( "a" ).attr( "href" ) )
30                                         .find( ".connectedSortable" );
31
32                                 ui.draggable.hide( "slow", function() {
33                                         $tabs.tabs( "option", "active", $tab_items.index( $item ) );
34                                         $( this ).appendTo( $list ).show( "slow" );
35                                 });
36                         }
37                 });
38         });
39         </script>
40 </head>
41 <body>
42
43 <div id="tabs">
44         <ul>
45                 <li><a href="#tabs-1">Nunc tincidunt</a></li>
46                 <li><a href="#tabs-2">Proin dolor</a></li>
47         </ul>
48         <div id="tabs-1">
49                 <ul id="sortable1" class="connectedSortable ui-helper-reset">
50                         <li class="ui-state-default">Item 1</li>
51                         <li class="ui-state-default">Item 2</li>
52                         <li class="ui-state-default">Item 3</li>
53                         <li class="ui-state-default">Item 4</li>
54                         <li class="ui-state-default">Item 5</li>
55                 </ul>
56         </div>
57         <div id="tabs-2">
58                 <ul id="sortable2" class="connectedSortable ui-helper-reset">
59                         <li class="ui-state-highlight">Item 1</li>
60                         <li class="ui-state-highlight">Item 2</li>
61                         <li class="ui-state-highlight">Item 3</li>
62                         <li class="ui-state-highlight">Item 4</li>
63                         <li class="ui-state-highlight">Item 5</li>
64                 </ul>
65         </div>
66 </div>
67
68 <div class="demo-description">
69 <p>Sort items from one list into another and vice versa, by dropping the list item on the appropriate tab above.</p>
70 </div>
71 </body>
72 </html>

UCC git Repository :: git.ucc.asn.au