Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let lastRecordedScroll = 0;
- export function disableScroll() {
- let bounds = app.body.getBoundingClientRect();
- lastRecordedScroll = -bounds.top;
- app.body.style.position = 'fixed';
- app.body.style.top = `-${lastRecordedScroll}px`;
- }
- export function enableScroll() {
- app.body.style.position = '';
- app.body.style.top = '';
- window.scrollTo(0, lastRecordedScroll);
- }
Add Comment
Please, Sign In to add comment