Guest User

Untitled

a guest
Mar 20th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. let lastRecordedScroll = 0;
  2.  
  3. export function disableScroll() {
  4. let bounds = app.body.getBoundingClientRect();
  5. lastRecordedScroll = -bounds.top;
  6. app.body.style.position = 'fixed';
  7. app.body.style.top = `-${lastRecordedScroll}px`;
  8. }
  9.  
  10. export function enableScroll() {
  11. app.body.style.position = '';
  12. app.body.style.top = '';
  13. window.scrollTo(0, lastRecordedScroll);
  14. }
Add Comment
Please, Sign In to add comment