get the start position of an item using the jquery ui sortable plugin

Posted by Rippo on Stack Overflow See other posts from Stack Overflow or by Rippo
Published on 2010-04-12T08:02:33Z Indexed on 2010/04/12 8:33 UTC
Read the original article Hit count: 363

Filed under:
|

I am using the jQuery UI sortable plugin and I am trying to get 2 alerts

I want the staring position of the element and the finished position of the element.

$(function() {
    $("#filterlist ul").sortable({ opacity: 0.6, cursor: 'move', update: function(event, ui) {
            alert(ui.item.prevAll().length + 1);
        }
    });
});

I can get the position of the item after it has been dragged by using:-

ui.item.prevAll().length + 1

What do I use to get the position it started from?

© Stack Overflow or respective owner

get the start position of an item using the jquery ui sortable plugin

Posted by Rippo on Stack Overflow See other posts from Stack Overflow or by Rippo
Published on 2010-04-12T08:01:31Z Indexed on 2010/04/12 8:03 UTC
Read the original article Hit count: 363

Filed under:

I am using the jQuery UI sortable plugin and I am trying to get 2 alerts

I want the staring position of the element and the finished position of the element.

$(function() {
    $("#filterlist ul").sortable({ opacity: 0.6, cursor: 'move', update: function(event, ui) {
            alert(ui.item.prevAll().length + 1);
        }
    });
});

I can get the position of the item after it has been dragged by using:-

ui.item.prevAll().length + 1

What do I use to get the position it started from?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ui-sortable