mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
demo: sortables: connectWith, dropOnEmpty, excluding items
This commit is contained in:
parent
5dd4dc208b
commit
858d5daad9
41
demos/sortable/connectwith.html
Normal file
41
demos/sortable/connectwith.html
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>jQuery UI Sortable - Connected lists</title>
|
||||||
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
|
<link type="text/css" href="../../themes/default/ui.all.css" rel="stylesheet" />
|
||||||
|
<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
|
||||||
|
<script type="text/javascript" src="../../ui/ui.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../ui/ui.sortable.js"></script>
|
||||||
|
<style type="text/css">
|
||||||
|
ul { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; }
|
||||||
|
li { margin: 3px; padding: 2px; width: 120px; }
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
$("ul").sortable({
|
||||||
|
connectWith: ['ul']
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li class="ui-state-default">Item 1</li>
|
||||||
|
<li class="ui-state-default">Item 2</li>
|
||||||
|
<li class="ui-state-default">Item 3</li>
|
||||||
|
<li class="ui-state-default">Item 4</li>
|
||||||
|
<li class="ui-state-default">Item 5</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li class="ui-state-highlight">Item 1</li>
|
||||||
|
<li class="ui-state-highlight">Item 2</li>
|
||||||
|
<li class="ui-state-highlight">Item 3</li>
|
||||||
|
<li class="ui-state-highlight">Item 4</li>
|
||||||
|
<li class="ui-state-highlight">Item 5</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
51
demos/sortable/droponempty.html
Normal file
51
demos/sortable/droponempty.html
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>jQuery UI Sortable - Dropping on empty lists</title>
|
||||||
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
|
<link type="text/css" href="../../themes/default/ui.all.css" rel="stylesheet" />
|
||||||
|
<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
|
||||||
|
<script type="text/javascript" src="../../ui/ui.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../ui/ui.sortable.js"></script>
|
||||||
|
<style type="text/css">
|
||||||
|
ul { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; background: #eee; padding: 5px; width: 133px;}
|
||||||
|
li { margin: 3px; padding: 2px; width: 120px; }
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
$("ul.droptrue").sortable({
|
||||||
|
connectWith: ['ul']
|
||||||
|
});
|
||||||
|
|
||||||
|
$("ul.dropfalse").sortable({
|
||||||
|
connectWith: ['ul'],
|
||||||
|
dropOnEmpty: false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<ul class='droptrue'>
|
||||||
|
<li class="ui-state-default">Can be dropped..</li>
|
||||||
|
<li class="ui-state-default">..on an empty list</li>
|
||||||
|
<li class="ui-state-default">Item 3</li>
|
||||||
|
<li class="ui-state-default">Item 4</li>
|
||||||
|
<li class="ui-state-default">Item 5</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class='dropfalse'>
|
||||||
|
<li class="ui-state-highlight">Cannot be dropped..</li>
|
||||||
|
<li class="ui-state-highlight">..on an empty list</li>
|
||||||
|
<li class="ui-state-highlight">Item 3</li>
|
||||||
|
<li class="ui-state-highlight">Item 4</li>
|
||||||
|
<li class="ui-state-highlight">Item 5</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<ul class='droptrue'>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<br clear="both" />
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -13,7 +13,9 @@
|
|||||||
<li><a href="floating.html">Floating</a></li>
|
<li><a href="floating.html">Floating</a></li>
|
||||||
<li><a href="placeholder.html">Placeholder</a></li>
|
<li><a href="placeholder.html">Placeholder</a></li>
|
||||||
<li><a href="delaydistance.html">Delay / Distance</a></li>
|
<li><a href="delaydistance.html">Delay / Distance</a></li>
|
||||||
|
<li><a href="items.html">Excluding items</a></li>
|
||||||
|
<li><a href="connectwith.html">Connecting two lists</a></li>
|
||||||
|
<li><a href="droponempty.html">Dropping on empty lists</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
49
demos/sortable/items.html
Normal file
49
demos/sortable/items.html
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title>jQuery UI Sortable - Items</title>
|
||||||
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
|
<link type="text/css" href="../../themes/default/ui.all.css" rel="stylesheet" />
|
||||||
|
<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
|
||||||
|
<script type="text/javascript" src="../../ui/ui.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../ui/ui.sortable.js"></script>
|
||||||
|
<style type="text/css">
|
||||||
|
ul { list-style-type: none; margin: 0; padding: 0; }
|
||||||
|
li { margin: 3px; padding: 2px; }
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
$("ul:eq(0)").sortable({
|
||||||
|
items: 'li:not(.ui-state-disabled)'
|
||||||
|
});
|
||||||
|
|
||||||
|
$("ul:eq(1)").sortable({
|
||||||
|
cancel: '.ui-state-disabled'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<p>Completely exclude items from the sorting logic using the 'items' option</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li class="ui-state-default">Item 1</li>
|
||||||
|
<li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
|
||||||
|
<li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
|
||||||
|
<li class="ui-state-default">Item 4</li>
|
||||||
|
<li class="ui-state-default">Item 5</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>Keep the items as valid targets, but non-draggable, using the 'cancel' option</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li class="ui-state-default">Item 1</li>
|
||||||
|
<li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
|
||||||
|
<li class="ui-state-default ui-state-disabled">(I'm not sortable)</li>
|
||||||
|
<li class="ui-state-default">Item 4</li>
|
||||||
|
<li class="ui-state-default">Item 5</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user