My buddy Alex was curious about having a background that moves as you scroll, so I whipped up this example to show the principles at work.
The example here uses our Projects post type, which are all just individual posts in a standard WordPress CPT. Title, excerpt, featured image. Standard stuff. In the page template, the background image has a little jQuery that makes it scroll to the left. The extra tasty icing on the cake is the calculation we make to work out the complete length of the screen. We use this to calculate the speed of background image – thus making sure that the logo reaches the end of its right > left journey at the same time you’re scrolling to the bottom of the screen. Moderately clever? B +
The titles are accidentally z-indexed behind the images. But, hey, maybe that’s cool.