How do I get the coordinate position after using jQuery drag and drop?

前端 未结 9 1349
北荒
北荒 2020-11-29 20:36

How do I get the coordinate position after using jQuery drag and drop? I want to save the coordinate to a database, so that next time I visit, the item will be in that posi

9条回答
  •  温柔的废话
    2020-11-29 20:56

    I was need to save the start position and the end position. this work to me:

        $('.object').draggable({
            stop: function(ev, ui){
                var position = ui.position;
                var originalPosition = ui.originalPosition;
            }
        });
    

提交回复
热议问题