Webpage - http://schnell.dreamhosters.com/spriteanimate.html
Just go to the page and "View Source" and you will see all the code.
Now itβs pretty simple. The right arrow key makes X right, the left arrow key makes it go left. It performs the current animation in the right direction, and the actual image element moves in one direction.
The main problem I'm facing right now is optimization. If you play a little with him, you will notice that the working animation is not always smooth, and during the first few seconds it feels very laggy, as if it is still loading something. Especially to blame for this animation to exit to the left. Another issue is with .animate () from jQuery. He makes a kind of stop-and-go movement, and you can tell. The motion of an image element is jerky and not very smooth.
.animate () from jQuery can be customized using mitigation, etc., but I'm not quite sure what the answer is and what still leaves me with a random run or something else. Anyone have any suggestions?
source share