Search code examples
jqueryjquery-animateinsertafter

jQuery insertAfter with movement animation?


How would I modify this code to show the animated movement (item moving from current location to the new location)?

http://jsfiddle.net/jT8Tt/25/

var order = [2, 3, 1, 5, 4];

for (var i = 1; i < order.length; i++) {
    $('li[data-number="' + order[i] + '"]').insertAfter($('li[data-number="' + order[i - 1] + '"]'));
}​

Solution

  • This plugin does not answer directly to your question, but addresses and resolves the same problem.