Stop moving an animation js

Hi everyone, I'm new to javascript.
I am creating a browser game and I have found some code on how to create an animation. E.g Image or another div.
So the problem here is that I have to move it into the MyContainer of 100 x 100 pixels. It's just in the bottom right corner of my screen. How to stop animation after 100 pixels for example?

Here is my code:





// css
#myContainer {
width: 100px;
height: 100px;
position: relative;
}
#myAnimation {
background picture:...
Code (markup):

Stop moving an animation js