jquery - How to get the "index" of a draggable element? -


for sortable element, use ui.item.index(). there equivalent draggable elements?

$('.elem').draggable({   start: function(event, ui){     //how "index" of ui.item?   } }); 

just use jquery.index() anywhere else:

$('.elem').draggable({     start: function () {         var myindex = $(this).index();         $(this).text('i #' + myindex);         } }); 

here's fiddle.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -