[jQuery] Sortable Element Position

[jQuery] Sortable Element Position


Hi,
I'm trying to figure out how i can get the current element position of
a sortable list after drag has complete. Should i be using traverse
for this??
code example:
the second alert gives me -1 as an index.
ie: <ul id="foo"><li>value</li><li>value</li><li>value</li></ul>
$("#foo").sortable({update:function(e)
                             {
                            alert(e.target.id);
                            alert($("foo").index(e.target));
                             }
        });