Last active
April 20, 2018 19:35
-
-
Save lincolnlemos/782f9301c7b36a30368ed99268cbd2eb to your computer and use it in GitHub Desktop.
Full screen responsive bootstrap menu with WordPress
This file contains hidden or 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
// Lock the screen in menu | |
.noscroll { overflow-y: hidden; } | |
// Make the menu full screen after collapse | |
.navbar-full { | |
.navbar-toggler { | |
z-index: 11; | |
&.collapsed { | |
+ .navbar-collapse { | |
z-index: -1; | |
opacity: 0; | |
transition: 250ms ease opacity; | |
} | |
} | |
} | |
.navbar-collapse { | |
height: 100vh !important; | |
height: auto; | |
overflow-y: scroll; | |
position: fixed; | |
display: block !important; | |
top: 0; | |
left: 0; | |
right: 0; | |
bottom: 0; | |
background-color: white; | |
transition: 250ms ease opacity; | |
opacity: 1; | |
z-index: 10; | |
&.collapsing, &.show { | |
display: block !important | |
} | |
} | |
} |
This file contains hidden or 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
// Update your js file to add class at body | |
// You will need jQuery for this. | |
$('.navbar-full button').click(function(event) { | |
$('body').toggleClass('noscroll'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment