• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stop jQuery animation in progress.

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
.stop()
 
William Rouse
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That ease Mr. Bibeault, thank you. I guess I can now move on to the hard part and write a continous loop.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure why you fee that you need a loop. You can just queue up the animations.
 
William Rouse
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic