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

105
Views
Display an div element when another div has reached the middle of the viewport

I'm creating a reading app and I have a page navigation div with previous and next arrows that will take the user to the previous or next chapter. However, I would like the stores to only display when the chapter text is on the screen but be hidden when showing the header or footer. I'm using JQuery and have found some scripts that show/hide elements based on the scroll position on the page. The issue with these are that the length of the header/footer can differ depending on the viewport. So I would like to only trigger (show) the navigation div when the '.maintext' div has reached the center of the viewport, and hide again when it exits. Any help is much appreciated..

about 4 years ago · Juan Pablo Isaza
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!