views:

146

answers:

1

Hello, I want to make something like this site: http://www.lionite.com Check the header, the city slides, how can this be done with jquery ?

Any plugin or tutorial would be great :)

Thanks

+2  A: 

That's really simple, and that site burns my CPU a lot (no idea why, it shouldn't do that - it's simple :P)

What You want is animating background position on a div or the whole body.

  1. create a background that can be repeated horizontally
  2. do the css so that it's shown and repeats on x
  3. use $().animate() on background position changing the x position up to the width of your background
  4. when animation ends change the x position back to 0 and run amination again.

it will look like You are scrolling the background all the time (if You synchronize it badly it will jump a bit on every position restart )

If You don't know how to do the css position bug me in comments ;)

naugtur
I agree, it's burning ~16% cpu in Chrome. That's pretty damn awful for a company website, especially when animating something so simple
Alex
On my 5yr old laptop usnig ff3.0 on ubuntu I got 100% CPU with that :D What is really amazing is that the animation was still smooth! :D
naugtur