<!----------------------------------- SORT LIST NORMAL (2) -->
<div class="col">
<div id="wrapper">
<h1>Ordinary Sortable List</h1>
<p>This is a basic drag and drop effect that allows you to sort the order of the list elements without saving. This can be implemented quickly to a number of different fields and areas or forms.</p>
<p>The javascript for this section is clearly labelled in the js/jsfunctions.js file where you can amend and add functions for each of these sections</p>
<ul id="sortlistTwo">
<li>New York</li>
<li>San Francisco</li>
<li>London</li>
<li>Manchester</li>
</ul>
</div>
</div>
<!----------------------------------- END -->
<!----------------------------------- SORT LIST TWO COLUMNS (3) -->
<div class="col">
<div id="wrapper">
<h1>Sort List into Two Columns</h1>
<p>This is a basic drag and drop effect that allows you to sort the order of the list elements without saving. This can be implemented quickly to a number of different fields and areas or forms.</p>
<p>The javascript for this section is clearly labelled in the js/jsfunctions.js file where you can amend and add functions for each of these sections</p>
<ul id="sortlistThree">
<li>New York</li>
<li>San Francisco</li>
<li>London</li>
<li>Manchester</li>
<li>Newcastle</li>
<li>Cape Town</li>
<li>Berlin</li>
<li>Paris</li>
<div class="clear"></div>
</ul>
</div>
</div>
<!----------------------------------- END -->
// JavaScript Document
//------------------------------ MAKE LIST FOR MYSQL (1)
$(function() {
$( "#sortlist" ).sortable({
update: function(){
$('#message').html('Items have been moved but not saved');
}
});
});
//--------- SAVE THE ORDER
$('#button').click(function(event){
var order = $("#sortlist").sortable("serialize");
$('#message').html('Saving changes..');
$.post("save.php",order,function(theResponse){
$('#message').html(theResponse);
});
event.preventDefault();
});
//------------------------------ SORT LIST NORMAL (2)
$(function() {
$( "#sortlistTwo" ).sortable({
});
});
//------------------------------ SORT LIST TWO COLUMNS (3)
$(function() {
$( "#sortlistThree" ).sortable({
});
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.