moving back to the position of a div is not correct jquery
I have a div and then move the div by using drag function of Jquery.
after dropping the item, I made it such a way that if I click on the item, it will be back to the old position.
I saved the ini开发者_StackOverflow中文版tial position of the div: offset()
and then set it again.
I check on the debug data, the initial and the position after moving back are the same but the div is not located at the same as it was.
where could be the problem?
Thanks in advance
Probabley the div is in a diffrent DOM location meaning its parent has changed unless it is position:absolute, try to save the parent element and the use the append method to append it the starting parent,
精彩评论