<div id="container">   
<div class="description panel">
    <div><h1>Layered pinning from bottom</h1>
      <p>A simple example where overlapping panels reveal from the bottom.</p>
      <div class="scroll-down">Scroll down<div class="arrow"></div></div>
    </div>
  </div>


  <section class="panel green">
    <h2>
      1
    </h2>
  </section>
  <section class="panel solid">
    <h2>
      2
    </h2>
  </section>
  <section class="panel purple">
    <h2>
      3
    </h2>
  </section>

</div>


#container {
  width: 100%;
  height: 100%; 
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
}

.panel {
  position: absolute;
  will-change: transform;
}

h2 {
  font-size: 30vw;
  opacity: 0.2
}
gsap.registerPlugin(ScrollTrigger);

gsap.to(".panel:not(:last-child)", {
  yPercent: -100, 
  ease: "none",
  stagger: 0.5,
  scrollTrigger: {
    trigger: "#container",
    start: "top top",
    end: "+=300%",
    scrub: true,
    pin: true
  }
});


gsap.set(".panel", {zIndex: (i, target, targets) => targets.length - i});
Run Pen

External CSS

  1. https://codepen.io/GreenSock/pen/xxmzBrw.css

External JavaScript

  1. https://assets.codepen.io/16327/gsap-latest-beta.min.js
  2. https://assets.codepen.io/16327/ScrollTrigger.min.js
  3. https://codepen.io/GreenSock/pen/7ba936b34824fefdccfe2c6d9f0b740b.js