From jQuery JavaScript Library
« Back to the jQuery UI Docs
Example:| Name | Type |
Basic Example of a sortable.
$("#myList").sortable({});
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$("#myList").sortable({});
});
</script>
<style>ul { list-style: none; }
li { background: #727EA3; color: #FFF; width: 100px; margin: 5px; font-size: 10px; font-family: Arial; padding: 3px; }</style>
</head>
<body>
<script src="http://dev.jquery.com/view/tags/ui/1.5b2/ui.base.js"></script>
<script src="http://dev.jquery.com/view/tags/ui/1.5b2/ui.sortable.js"></script>
<ul id="myList">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>
</body>
</html>