Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

315
Views
Scroll two DIVs havnig different heights similar to a parallax effect

I've been scanning the web for a simple solution possibly without using a 3rd party library.

Consider the following section in a web page with other sections above and below it:

    <section class="about">
  <div class="about-title">
    <h1>About Me</h1>
  </div>
  <div class="about-pages">
    <div>
      <h2>Project 1</h2>
      <p>
        Lorem ipsum dolor sit amet consectetur adipisicing elit. Nam
        excepturi assumenda neque ipsum vel vitae, aliquid minima, totam
        inventore provident aspernatur pariatur nulla voluptatibus possimus,
        quas atque quis doloremque! Unde explicabo doloremque autem ipsa
        provident voluptates mollitia tenetur alias natus, iste libero
        dolore dicta minus nostrum nihil! Dicta, vel alias.
      </p>
    </div>
    <div>
      <h2>Project 2</h2>
      <p>
        Lorem ipsum dolor sit amet consectetur adipisicing elit. Nam
        excepturi assumenda neque ipsum vel vitae, aliquid minima, totam
        inventore provident aspernatur pariatur nulla voluptatibus possimus,
        quas atque quis doloremque! Unde explicabo doloremque autem ipsa
        provident voluptates mollitia tenetur alias natus, iste libero
        dolore dicta minus nostrum nihil! Dicta, vel alias.
      </p>
    </div>
    <div>
      <h2>Project 3</h2>
      <p>
        Lorem ipsum dolor sit amet consectetur adipisicing elit. Nam
        excepturi assumenda neque ipsum vel vitae, aliquid minima, totam
        inventore provident aspernatur pariatur nulla voluptatibus possimus,
        quas atque quis doloremque! Unde explicabo doloremque autem ipsa
        provident voluptates mollitia tenetur alias natus, iste libero
        dolore dicta minus nostrum nihil! Dicta, vel alias.
      </p>
    </div>
  </div>
</section>

I would like to scroll the page and once I get to this section, I would like the DIV with class about-pages page to scroll to its end and then the whole page continues to scroll - a parallax effect.

I found this a demo that uses the ScrollMagic library but the trouble is that the example sets pre-defined height for the DIV about-pages. In my real scenario this DIV's height is not known as it can vary overtime.

Is there a pure CSS solution to this? If not, does anybody know how to adapt the ScrollMagic (not my preferred way), to achieve this?

Here is the example I found on YouTube with ScrollMagic but I could not adapt it to cases where the RHS DIV's height is not known.

Thanks for any feed backs.

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!