返回列表 發帖

how to click to know the position in sortable list

i have the following code to get the change of position, I dont know how to make the list tell me the position of a specific element when i click it.
please give some idea.
  • $( "#sortable" ).sortable(
  • {
  •                start:function(event, ui) {

  •   startpos=( $(ui.item).prevAll().length );
  •                },
  •                stop:function(event, ui) {
  •                        stoppos=($(ui.item).prevAll().length );
  •                }
  • });

返回列表 回復 發帖