Here is a sample of my HTML code:
<div id="a" class="panels">FIXED PANEL</div>
<div id="b" class="panels">Scrolling-Panel 1</div>
<div id="c" class="panels">Scrolling-Panel 2</div>
<div id="d" class="panels">Scrolling-Panel 3</div>
In my layout, I want the <div>
with ID b
to appear on top of the <div>
with ID a
, and the <div>
with ID d
to appear on top of the <div>
with ID c
. Both divisions have the same size. I've tried adding position:fixed
and top:0
to the first <div>
with ID a
, but I'm not achieving the desired effect. The first <div>
keeps repeating every time another <div>
goes on top. I understand that this issue stems from using position:fixed
, but I'm unsure how to resolve it in order to create a parallax effect for all divisions.
I created a demo showcasing my issue: http://jsfiddle.net/1g8sLnfk/5/