Andrei RRR
Andrei RRR

Reputation: 3162

AJAX Script - Similar to Wordpress Widgets Arrange

I had built my own CMS and I need to create an AJAX script to arrange elements in the website. I will need one similar to the Wordpress one, when you have to arrange the widgets in the siderbar.

Could someone help me with a link to a tutorial or something?

Thanks

Upvotes: 1

Views: 290

Answers (2)

Naftali
Naftali

Reputation: 146310

Here is a fiddle with some of the functionality you want: http://jsfiddle.net/maniator/26UNk/

JS:

$("#content ul").sortable({
    opacity: 0.6,
    cursor: 'move',
    update: function() {
        var order = $(this).sortable("serialize") + '&action=updateRecordsListings';
        $.post("updateDB.php", order, function(theResponse) {
            //some sort of ajax code
        });
    }
});

Upvotes: 2

Martijn
Martijn

Reputation: 1719

Here's a tutorial using Prototype/Scriptaculous:

http://webdesign.torn.be/tutorials/javascript/prototype/sort-images-with-prototype/

I'm sure there are tens of tutorials available using various Javascript libraries or plain Javascript. Try searching for 'drag drop javascript' or 'sortable list javascript'.

Upvotes: 0

Related Questions