Created
March 14, 2016 00:38
-
-
Save searleb/858ad354b03cc0f86801 to your computer and use it in GitHub Desktop.
Prevent page scrolling - eg when using a full screen nav overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// prevent page scrolling when mobile menu is visible | |
$('.navbar-toggle').on('click', function() { | |
$('body').toggleClass('no-scroll'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body{ | |
&.no-scroll{ | |
overflow: hidden; | |
position: fixed; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment