How to keep page content from scrolling without disabling scrolling?

Viewed 44

Alright so I'm really stumped by this one. How can I lock the page's scroll position to a specific value? I can't use overflow: hidden; on the body, because that prevents scroll events from firing entirely. I can't use scrollTo(0,0) every time the scroll event fires, because that causes a terrible stuttering effect.

What can I do? How can I lock the scroll at a specific spot? I've been scouring the internet and I've found nothing. A friend and I have been working on this for like an hour and can't think of anything at all. Any help is appreciated!

EDIT: I'd like to achieve an effect identical to what is shown on this page: https://www.apple.com/ie/macbook-pro-16/

0 Answers
Related