开发者

i want to select the current element when i used sortable

// i want when you dragged the element in the new postion // the selected option is changed according to the new postion // check the item before and the item after dragging // the item that you daragged take the right selected option 1 2 3 12 3 开发者_StackOverflow中文版 1 2 3

when i used this code

$(document).ready(function(){
      $("#contain").sortable({
          stop: function(event, ui){
               // i want to take the value of the current
              currItem=$(this).find('option:selected').text();
              alert(currentItem); // this display all item and i want the current element only 


          }
      });


If you want the current item being dragged use

$(document).ready(function(){
$("#contain").sortable({
    stop: function(event, ui){
         // i want to take the value of the current
        var currItem = ui.item;
        alert(currentItem); // this display all item and i want the current element only 
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜