I made a fiddle here
HTML
<div class="section">
<img class="glasses" src="https://cdn.pbrd.co/images/GEpcSsv.png" alt="">
<div class="text">
<div class="text-wrap">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Optio quisquam enim, voluptatem, inventore corrupti obcaecati ab veritatis nisi unde modi eius accusantium in fugit! Et impedit, assumenda culpa, a minus illo voluptate aperiam esse inventore dolorum rerum, reprehenderit repellat, numquam repellendus amet voluptatem veritatis. Et omnis, minus! Ea quasi assumenda vitae dolores blanditiis, qui voluptas sed adipisci a ipsa quo excepturi in labore totam praesentium similique, deserunt eius modi, dolore commodi rerum, saepe distinctio. Delectus qui facere, saepe similique non rem laboriosam odit ducimus, corporis ullam aliquid in fugit recusandae perspiciatis ipsum! Voluptate eaque maiores deserunt consequuntur vero adipisci deleniti.</p>
</div>
</div>
</div>
CSS
.section{
position: relative;
height: 2000px;
}
.section img.glasses{
position: fixed;
top: 15%;
z-index: 3;
}
.section .text{
position: relative;
top: 300px;
left: 230px;
height: 100%;
width: 350px;
background-color: red;
border: 10px solid red;
z-index: 2;
}
Basically I want the content to only show when it hits a certain point (in this case the lens of the glasses). I'm stuck. I've been trying for a whole day.
The closest answer i've found is this post: parent & child with position fixed, parent overflow:hidden bug
but I need the parent to scroll with the frame. Is there a work around where the parent container can still be fixed while the child can be scrolled?