ブラウザ上で何かのリストの順序変更(ソート)できるようにするのってメンドーだけど、とても簡単にしてくれるライブラリ。すごいなぁ、これ。script.aculo.us - web 2.0 javascript
サンプルコード
<html>
<head>
<script type="text/javascript" src="/samples/js/prototype.js"></script>
<script type="text/javascript" src="/samples/js/scriptaculous.js"></script>
<style type="text/css">
li { cursor: pointer; }
</style>
<title>Sortable List Sample</title>
</head>
<body>
ドラッグ&ドロップでソートできます。
<ul id="list">
<li id="list_1">Item1</li>
<li id="list_2">Item2</li>
<li id="list_3">Item3</li>
</ul>
<script type="text/javascript">
Sortable.create("list"); <-- これだけ!
</script>
<form>
POST用データ作ります。
<input type="button" value="serialize" onclick="alert(Sortable.serialize('list'))"/>
</form>
<a href="/">groundwalker.com</a>
</body>
</html>
groundwalker.com