Initially, the child element opacity is set to 0 except for the first child that is already on top, and when the scroll happens the next child to reach the top of the parent container, opacity will be set to 1 and the same thing happens for the rest of the child.
<div class="parent"> // scrollable parent container
<div class="child">I am child 1</div> // currently visible child with opacity 1
<div class="child">I am child 2</div> // next child element with opacity 0.5
<div class="child">I am child 3</div> // next child element with opacity 0.5
.....
</div>
I've seen this post Increase element opacity when user scrolls down the page , but this one is jquery. Can't find something similar for pure javascript and also this only contain one child element.
Don't know where to start. Any help is very much appreciated.