Reputation: 5325
I have three div in a page I want user can reposision div as the want
<div class="A"></div>
<div class="B"></div>
<div class="C"></div>
Originally it is ordered ABC. User can reposition div as CBA, CAB as user want How to do this.
Upvotes: 0
Views: 65
Reputation: 1333
HTML :
<div class="sortable">
<div class="A"></div>
<div class="B"></div>
<div class="C"></div>
</div>
Jquery :
<script>
$(function() {
$( "#sortable" ).sortable();
$( "#sortable" ).disableSelection();
});
</script>
Add these jquery files to your code :
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
Upvotes: 3