Is there a way to do the following in jQuery:
- Animate DIV to
left: -200px; top: -200px - Animate DIV to
left: 0px; top: -400px - Animate DIV to
left: -200px; top: -600px - Go to 1, repeat till some user event interrupts
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I didn’t quite follow what exact dimensions you wanted, but you can fill in the values you want. Here’s the general idea. jQuery animations go in a queue and are naturally chained one after the other so you can just fire them all off and it will queue them up and then use the completion function on the last one to start it over again like this:
You can stop the animation at any time by calling the jQuery
.stop(true)method on the animating object. Here’s a working demo: http://jsfiddle.net/jfriend00/PnzQ9/