How do I get position x and y from jQuery ui draggable?

前端 未结 4 2313
灰色年华
灰色年华 2020-12-30 17:04

Here an example http://jsfiddle.net/naqbq/

How do I grab current position for x and y after re-position the image?



        
4条回答
  •  灰色年华
    2020-12-30 17:25

    You should use the built in stop event:

    $("#image").draggable({
        stop: function() { 
            // check for positioning here using .css or .offset
        }
    });
    

提交回复
热议问题