문제

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/

도움이 되었습니까?

해결책

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/

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top