Skip to content

Instantly share code, notes, and snippets.

@davidverhage
Created November 19, 2018 19:38
Show Gist options
  • Save davidverhage/b0b953671e148b5e39f82c9849cb5eb6 to your computer and use it in GitHub Desktop.
Save davidverhage/b0b953671e148b5e39f82c9849cb5eb6 to your computer and use it in GitHub Desktop.
Very handy function to avoid overflow on pages that are not to be scrolled
function reloadScrollBars() {
document.documentElement.style.overflow = 'auto'; // firefox, chrome
document.body.scroll = "yes"; // ie only
}
function unloadScrollBars() {
document.documentElement.style.overflow = 'hidden'; // firefox, chrome
document.body.scroll = "no"; // ie only
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment