1 | <!doctype html>
|
---|
2 | <html lang="en">
|
---|
3 | <head>
|
---|
4 | <title>jQuery UI Sortable - Portlets</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 | .column { width: 170px; float: left; padding-bottom: 100px; }
|
---|
14 | .portlet { margin: 0 1em 1em 0; }
|
---|
15 | .portlet-header { margin: 0.3em; padding-bottom: 4px; padding-left: 0.2em; }
|
---|
16 | .portlet-header .ui-icon { float: right; }
|
---|
17 | .portlet-content { padding: 0.4em; }
|
---|
18 | .ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important; }
|
---|
19 | .ui-sortable-placeholder * { visibility: hidden; }
|
---|
20 | </style>
|
---|
21 | <script type="text/javascript">
|
---|
22 | $(function() {
|
---|
23 | $(".column").sortable({
|
---|
24 | connectWith: '.column'
|
---|
25 | });
|
---|
26 |
|
---|
27 | $(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
|
---|
28 | .find(".portlet-header")
|
---|
29 | .addClass("ui-widget-header ui-corner-all")
|
---|
30 | .prepend('<span class="ui-icon ui-icon-minusthick"></span>')
|
---|
31 | .end()
|
---|
32 | .find(".portlet-content");
|
---|
33 |
|
---|
34 | $(".portlet-header .ui-icon").click(function() {
|
---|
35 | $(this).toggleClass("ui-icon-minusthick").toggleClass("ui-icon-plusthick");
|
---|
36 | $(this).parents(".portlet:first").find(".portlet-content").toggle();
|
---|
37 | });
|
---|
38 |
|
---|
39 | $(".column").disableSelection();
|
---|
40 | });
|
---|
41 | </script>
|
---|
42 | </head>
|
---|
43 | <body>
|
---|
44 | <div class="demo">
|
---|
45 |
|
---|
46 | <div class="column">
|
---|
47 |
|
---|
48 | <div class="portlet">
|
---|
49 | <div class="portlet-header">Feeds</div>
|
---|
50 | <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
|
---|
51 | </div>
|
---|
52 |
|
---|
53 | <div class="portlet">
|
---|
54 | <div class="portlet-header">News</div>
|
---|
55 | <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
|
---|
56 | </div>
|
---|
57 |
|
---|
58 | </div>
|
---|
59 |
|
---|
60 | <div class="column">
|
---|
61 |
|
---|
62 | <div class="portlet">
|
---|
63 | <div class="portlet-header">Shopping</div>
|
---|
64 | <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
|
---|
65 | </div>
|
---|
66 |
|
---|
67 | </div>
|
---|
68 |
|
---|
69 | <div class="column">
|
---|
70 |
|
---|
71 | <div class="portlet">
|
---|
72 | <div class="portlet-header">Links</div>
|
---|
73 | <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
|
---|
74 | </div>
|
---|
75 |
|
---|
76 | <div class="portlet">
|
---|
77 | <div class="portlet-header">Images</div>
|
---|
78 | <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div>
|
---|
79 | </div>
|
---|
80 |
|
---|
81 | </div>
|
---|
82 |
|
---|
83 | </div><!-- End demo -->
|
---|
84 |
|
---|
85 | <div class="demo-description">
|
---|
86 |
|
---|
87 | <p>
|
---|
88 | Enable portlets (styled divs) as sortables and use the <code>connectWith</code>
|
---|
89 | option to allow sorting between columns.
|
---|
90 | </p>
|
---|
91 |
|
---|
92 | </div><!-- End demo-description -->
|
---|
93 |
|
---|
94 | </body>
|
---|
95 | </html>
|
---|