-
AuthorPosts
-
March 18, 2016 at 3:37 pm #843570
EricParticipantHi I am trying to make my nav bar go solid as you scroll. I see hundreds of people with the same question and I have added your suggestions to the css and javascript and I have only found one CSS edit that works, but I can’t find any javascript edits that will make it go solid as you scroll down.
This is the CSS edit that made the nav bar transparent, would you be able to offer some advice on the JQuery to use?
body .x-navbar {
background-color: rgba(41,37,37, 0.0) !important;
}body.x-navbar-fixed-top-active .x-navbar-wrap {
position: fixed;
z-index: 10000;
width: 100%;
}.x-navbar {
transition: 0.2s all linear;
}.x-navbar.alt-color {
background-color: #333333;
}March 18, 2016 at 3:38 pm #843571
EricParticipantThis reply has been marked as private.March 18, 2016 at 10:22 pm #843930
RadModeratorHi there,
Thanks for posting in.
Please replace your provided CSS with this,
.x-navbar { background: transparent !important; transition: 0.2s all linear; } .x-navbar.x-navbar-fixed-top { transition: 0.2s all linear; background: rgba(41,37,37, 0.9) !important; }Then add this code to Admin > Appearance > Customizer > Custom > Javascript
jQuery ( function($) { $(window).scroll( function() { if ( $(this).scrollTop() > 0 ) { $('.x-navbar').addClass( 'x-navbar-fixed-top' ); } else { $('.x-navbar').removeClass( 'x-navbar-fixed-top' ); } } ); } );Hope this helps.
March 19, 2016 at 7:18 am #844230
EricParticipantHi! This kind of worked. It made the nav bar white but it does transition to #333333 when you scroll down. How do we fix the white part?
Thanks.
March 19, 2016 at 8:49 am #844279
ThaiModeratorHi There,
Try adding the following CSS under Customizer > Custom > CSS:
header.masthead.masthead-inline { position: absolute; width: 100%; }Hope it helps 🙂
March 19, 2016 at 8:58 am #844285
EricParticipantYes!
Thank you!
March 19, 2016 at 9:54 am #844312
EricParticipantHi one last little thing. How can I make the mobile nav button transparent as well?
March 19, 2016 at 10:10 am #844319
ThaiModeratorHi There,
Please add the following CSS:
a.x-btn-navbar { background-color: transparent !important; box-shadow: none !important; }Hope it helps 🙂
March 19, 2016 at 10:23 am #844324
EricParticipantNevermind. I got it!
March 19, 2016 at 10:24 am #844325
EricParticipantThanks! 🙂
March 19, 2016 at 11:14 am #844377
ThaiModeratorYou’re very welcome 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-843570 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
