So I have this website that has a large image as the background. Now instead of fading the image of to a flat colour or pattern, I needed it to scale to 100% of the viewport width.
This doesn't solve the problem that you'd only be able to see a portion of the image (depending on the browser size) and I need to have the whole image viewable. Just scrolling down won't suffice because then the image would end and what ever colour I chose for the background would appear (this is bad).
So I was thinking what if I could have
- the background image scale to 100% of the width of the viewport with a minimum size of the image width and
- also animate vertically down on scroll until
- you reach the end of the image height, which it will then stop until you scroll back up and it resumes to the top of the image,
- with a parallax effect.
Having each of these separately is easy enough but I haven't been able to find a combination of them and with a modification to limit vertical scrolling. If someone can point me in the right direction I would be ever-so grateful. :D