Created
October 12, 2018 16:47
-
-
Save epatr/ee10000b584186ce24d7f44d03a7f28b to your computer and use it in GitHub Desktop.
Bootstrap Scrollspy Stylized
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
<body data-spy="scroll" data-target="#navbar-submenu" > | |
<nav id="navbar-submenu" class="navbar navbar-light bg-light py-0"> | |
<ul class="nav m-auto justify-content-center"> | |
<li class="nav-item"><a class="nav-link page-scroller" href="#understanding-the-home-energy-score">Understanding the Score</a></li> | |
<li class="nav-item"><a class="nav-link page-scroller" href="#realtors-and-agents-sell-homes-faster">Real Estate</a></li> | |
<li class="nav-item"><a class="nav-link page-scroller" href="#become-a-certified-assessor">Become an Assessor</a></li> | |
</ul> | |
</nav> |
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
// Scrollspy sticker submenu | |
#navbar-submenu { | |
font-family: $font-family-sans-serif; | |
text-transform: uppercase; | |
text-align: center; | |
@include media-breakpoint-up(md) { | |
a { | |
position: relative; | |
text-decoration: none; | |
&:before { | |
content: ""; | |
position: absolute; | |
width: 100%; | |
height: 2px; | |
bottom: 0; | |
left: 0; | |
background-color: theme-color('primary'); | |
visibility: hidden; | |
transform: scaleX(0); | |
transition: all 0.3s ease-in-out 0s; | |
} | |
&:hover, &.active { | |
background-color: $gray-200; | |
transition: all .3s; | |
&:before { | |
visibility: visible; | |
transform: scaleX(1); | |
} | |
} | |
} | |
} | |
@include media-breakpoint-up(md) { | |
position: sticky; | |
top: 0; | |
z-index: 1020; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment