You can do it by using jQueryUI. there's a very nice example here:
http://www.shopdev.co.uk/blog/sortable-lists-using-jquery-ui/
Marcos Placona
2010-03-03 14:50:24
You can do it by using jQueryUI. there's a very nice example here:
http://www.shopdev.co.uk/blog/sortable-lists-using-jquery-ui/
The TinySort plugin should sort you out: http://plugins.jquery.com/project/TinySort
As long as you know the positions you want to go in and move around you can. Here's an example:
In this case remove the :eq(2)
(third, 0 based) element, then insert it after the first.
$(document).ready(function(){
$("ul li:eq(2)").remove().insertAfter($("ul li:eq(0)"));
});
<ul>
<li>
<div id="div1"> first </div>
</li>
<li>
<div id="div2"> second </div>
</li>
<li>
<div id="div3"> third </div>
</li>
</ul>
There are a few other options as well, but the answer is yes you can do this.