I have two Navbars with fixed-top
classes displayed one below the other - second one having top: *height of first navbar*
css added to it.
I think you should wrap both navbars in a single DIV, and make that the data-toggle="affix"
element. This way you only make the outer DIV fixed, and the second navbar will naturally follow the height of the 2nd since both are static position.
https://www.codeply.com/go/DpHESPqZsx
Adjust the CSS to apply the padding animation to the top navbar instead of the affix element:
.fixed-top #first {
-webkit-transition:padding 0.2s ease;
-moz-transition:padding 0.2s ease;
-o-transition:padding 0.2s ease;
transition:padding 0.2s ease;
}
.affix #first {
padding-top: 0.2em !important;
padding-bottom: 0.2em !important;
-webkit-transition:padding 0.2s linear;
-moz-transition:padding 0.2s linear;
-o-transition:padding 0.2s linear;
transition:padding 0.2s linear;
}