EasyUI Forum

General Category => General Discussion => Topic started by: contestant on August 13, 2015, 02:53:07 PM



Title: How to drop in same position?
Post by: contestant on August 13, 2015, 02:53:07 PM
Hi
How can drop an element to same position that drag on it?
In the other words, How can get the current dragged element position to recreate it in same position.
Thanks ;)


Title: Re: How to drop in same position?
Post by: contestant on August 14, 2015, 01:57:14 PM
Thank's for your very quick answer.
I fixed it myself as below:

var obj = $(source).draggable('proxy');
                if(obj)
                    elm.css({ position:'absolute', left:obj.css("left").replace(/px/, "") - $("#content").offset().left, top:obj.css("top").replace(/px/, "") - $("#content").offset().top});