-
Notifications
You must be signed in to change notification settings - Fork 1
toggleBodyOverflow
kherP edited this page Jan 2, 2020
·
2 revisions
This utility inserts a class into the body tag to disable overflow to avoid background scrolling.
toggleBodyOverflow(true);
console.log(document.body.classList.contains("overflow-hidden")); // true
Param | Type | Description |
---|---|---|
toggle | boolean | to toggle class overflow-hidden 1 in document.body |
- It inserts the class
overflow-hidden
which is a bootstrap class. If you are not using bootstrap, please make sure that the class is defined withoverflow: hidden;