Animation translation how to modify to the position of the animation

Animation translation how to modify to the position of the animation

Hi everyone,

I'm kinda stuck, I found out another topic but it didn't help me at all.

Here the situation, I load the page, I animate an element and I make it move from a point to a point.

$(element).animate({left: '+=400', top: '+=400'}, { queue: false, duration: 1000 }, function(){
});

This is working but I am willing to make it move in another way in the same time when I press a button.

It works, when I press the button, the element moves but when the second animation is completed the element comes back where it was before the second animation.

So, in my mind, the animation is using a variable to store the position of the element instead of the real CSS position.

Any ideas how to fix that?