In playing with jQuery to understand it better in a doing way, I made a project for myself to have a square move from right to left in the browser and then back again. So far I was able to make a function that does one iteration and another that resets the square but before I try to understand how to keep the loop continuously I was hoping to write code to stops the animation with another click event, but don’t know how to do that. If you can please point me where to look for clues?
Here is the code I have written so far.
I tried this experiment in the file listed below. It is some progress but not at all what I expected. I can't stop it or reset it. The div hesitates before it starts.
Do you think I am on the right track? I started to read about queues to see if I need to purge something.
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss