3

I'm trying to use jQuery to make a background position of my span go down 10 pixels every second. What is a good way to do this?

I've been playing with jQuery animate, delay, CSS, and some setTimeout functions but I can't get anything to work. Suggestions greatly appriciated!

I'm trying to make my y-position go from 0 to 100 in increments of 10 pixels, and then stop the animation.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sanpall
  • 2,051
  • 2
  • 13
  • 4
  • Can you share the latest state of your experiments so that we can point out what's wrong with your approach/implementation? – Ates Goral Mar 08 '10 at 20:07

1 Answers1

2

jQuery can't animate background position properly because of the need to animate two values instead of just one. Explanation and solution here:

http://snook.ca/archives/javascript/jquery-bg-image-animations/

ghoppe
  • 21,452
  • 3
  • 30
  • 21