开发者

i want to select the current element when i used sortable

开发者 https://www.devze.com 2023-03-14 04:14 出处:网络
// i want when you dragged the element in the new postion // the selected option is changed according to the new postion

// 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

精彩评论

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