In the above code d1 is the ID of the image, we have moved this image by 100px from its current position.
left : "+=100px" > Move the image by 100px from left edge from its current position
top : "+=100px" > Move the image by 100px from top edge from its current position
Here we have used one CSS value the left position and changed it to get the animation. In addition to this animation method takes three more optional parameters.
Here is the syntax with all options.
The above line is kept inside the function start_move() , so the animation continues again and again. To stop the movement we have kept one end limit of 400 px. Once the position reached more than 400 px, the position of the image is changed to 100px by using offset()