Reputation: 4999
Here is the link to the website of the example I want to show Smokey Bones Menu. Scroll down the page and see how the divs overlap each other but its more complex than this, because the actual page is scrolling too. Would anyone be able to help in answering how to achieve this effect?
Upvotes: 1
Views: 872
Reputation: 2191
I assume you are referring to the backgrounds of the dishes.
The effect has two components:
a) The CSS property background-attachment: fixed;
. This prevents the background image from scrolling with the divs. (This is not dependent on JavaScript)
b) A JavaScript which moves the background by changing background-position
slightly on scroll.
Upvotes: 4
Reputation: 44589
Here's plugin doing something pretty similar: https://github.com/IanLunn/jQuery-Parallax
You can search for parallax effet on Google for more example/scripts
Hope this help !
Upvotes: 1