Question

i had some code of a draggable object which links to a sortable. The issue is that i want to get the index of the helper in regards to the sortable object.

I was trying ui.helper.index() ( and $("div.tar").index(ui.helper); ) which gets the index in relation to its siblings, but it didn't seem the indexof ui.helper in the sortable list.

Am i doing something wrong?

here is a fiddle: http://jsfiddle.net/y2tGv/

Was it helpful?

Solution

Since the draggable event is causing the sortable events to fire, you would need to have a stop event fire such as:

`stop: function(event,ui){ console.log("This is the Index:", $(this).index());}`

see the fiddle: http://jsfiddle.net/y2tGv/1/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top