Skip to content

Instantly share code, notes, and snippets.

@besrabasant
Last active August 29, 2018 11:05
Show Gist options
  • Save besrabasant/fad0a0cd8a5b7befeafa2cbd27389d4a to your computer and use it in GitHub Desktop.
Save besrabasant/fad0a0cd8a5b7befeafa2cbd27389d4a to your computer and use it in GitHub Desktop.
Prevent Scrolling of background when overlay menu is open

Preventing Scrolling Background of when Overlay menu is open

Define a css rule

body.noscroll {
overflow: hidden;
}

Now just toogle the class on opening and closing of overlay menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment