| Author |
Stop jQuery animation in progress.
|
William Rouse
Ranch Hand
Joined: Apr 12, 2006
Posts: 73
|
|
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.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56175
|
|
|
.stop()
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
William Rouse
Ranch Hand
Joined: Apr 12, 2006
Posts: 73
|
|
|
That ease Mr. Bibeault, thank you. I guess I can now move on to the hard part and write a continous loop.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56175
|
|
|
Not sure why you fee that you need a loop. You can just queue up the animations.
|
 |
William Rouse
Ranch Hand
Joined: Apr 12, 2006
Posts: 73
|
|
Bear:
I got to learn new ways to think, I guess. Let me grab your book from a box (I'm in the middle of a slow move) and see how to do that. Thanks for the clues.
|
 |
William Rouse
Ranch Hand
Joined: Apr 12, 2006
Posts: 73
|
|
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 agree. Here's the link: jrebel
|
|
subject: Stop jQuery animation in progress.
|
|
|