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

374
Views
How do I allow only scrolling upwards and disable scrolling downwards?

I have an event listener and you can scroll on my webpage until window.scrollY is larger than 50. If you reach the 50 with window.scrollY, then you are only allowed to scroll upwards. If you are e.g. at 47 then you can scroll downwards to 50 again. I currently implemented it with window.scroll(0, 50); to prevent scrolling below 50, but if you try to scroll below 50 the webpage is jumpy/glitchy. Do you have any suggestions?

onScroll() {
  this.scrollPosition = window.scrollY;
  this.newValue = window.pageYOffset;
  if (window.scrollY > 50) {
    if (this.oldValue < this.newValue) {
      // Do not scroll below 50
      window.scroll(0, 50);
    }
  }
  this.oldValue = this.newValue;
}

Overview image As you can see in the image, there is an overlay menu. The menu appears on top of the contents after pressing an icon.

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!