For my website design, I have a <div class="stuffhere"></div>
where the content is stored. There are 2 of these div's. The second one is in front of the first one, with the help of z-index:
Also the content in both stuffhere
tags are duplicated, but sometimes the images in the top layer stuffhere
is replaced with spacers.
I can describe the reason for this setup best with an image.
Update: (new images!) how my code renders the page http://img5.imageshack.us/img5/8246/portfolio4.png
Notice how the Casey web design image is not affected by the stripy background, whereas the other blocks are. The Casey web design image is the only element on the screenshot which is not tinted by the background.
This is because elements inside the back div are tinted with the stripey background, whereas elements in the front div are not.
The back div has an opacity of 0.55 with the stripy background. As the front div has no background and has an opacity of 1, its contents are not affected by the stripy background, hence it's not tinted. Yes it does tint. I can illustrate that with another image.
In the same code snapshot below, showing you it again, you will see that for some images overlap each other. A good example of this is the one called work_title_heroesforhire.png
and work_title_heroesforhire-F.png
Why is this?
Below is the image without the F suffix. It's affected by opacity as it's placed in the back layer.
Below is the image with the F suffix. It's not affected by opacity as it's placed in the front layer.
This is why the text inside the screenshots does not have a tint of the stripy background.
Now you understand how my design works, here's the problem. When I scroll, this happens...
How can I make 2 div's scroll at the same time? Is there a way I can synchronise the scrolling of 2 div's with javascript? JQuery is preferable.
Here is an example that positions the bottom div dynamically behind the top div and as you scroll the top div, the bottom div dynamically scrolls.