Tagged: cornerstone
-
AuthorPosts
-
November 2, 2016 at 11:26 am #1241021
RichWarner89ParticipantHello! I’ve been browsing the forums and found several threads on this. Im close!
Here is the code I have been using:@media(min-width: 768px) {
.x-navbar.x-navbar-fixed-top {
background: transparent;
border: none;
box-shadow: none;
}.x-navbar.x-navbar-fixed-top.x-navbar-solid {
background: #ffffff;
box-shadow: 0 0.15em 0.35em 0 rgba(0,0,0,0.135);
}.home .x-slider-container {
margin-top: -70px;
}and the custom JS:
JQuery(function($) {
$(window).scroll(function(){
var W = $(window).width();
if($(window).scrollTop() >50 && W > 768) {
$(‘.x-navbar’).addClass(“x-navbar-solid”);
}else {
$(‘.x-navbar’).removeClass(“x-navbar-solid”);
}
});
});However, this sets the header up just how I want it BEFORE scroll. The header remains transparent with no border or box shadow (like the standard integrity 01 header).
I just need the header to go back to normal when scrolling now! 🙂
November 2, 2016 at 11:28 am #1241022
RichWarner89ParticipantThis reply has been marked as private.November 2, 2016 at 1:44 pm #1241246
JadeModeratorHi there,
Please add this code in the custom JS:
jQuery(function($){ $(window).scroll(function(){ if( $(this).scrollTop() == 0 ) { $('.x-navbar-fixed-top').removeClass('x-navbar-fixed-top'); } }) });Then add this in the custom CSS:
.masthead-inline { position: absolute; top: 0; left: 0; width: 100%; } .x-navbar-fixed-top { background-color: #fff; }Hope this helps.
November 2, 2016 at 5:36 pm #1241530
RichWarner89Participantshould i add this in addition? or replace?
November 2, 2016 at 5:42 pm #1241536
RichWarner89ParticipantSo i added both in addition to what I had and it seems to work just fine. one thing I do want to change is the transition from transparent to solid, how do you make it a fade to white? versus the abrupt change to white?
November 2, 2016 at 5:47 pm #1241539
RichWarner89Participant*update* I ‘saved’ and then viewed page and now the menu remains transparent. What is going on!?
November 2, 2016 at 11:55 pm #1241910
RadModeratorHi there,
Hmm, that’s weird and could be related to cache. Though, I’m a bit confused, should it start transparent then fade to white, or start at white then fade to transparent? It starts on white on my view then transition to transparent which I think different from the coding.
Would you mind providing your login credentials? I like to try something else but I need to disable that exist code temporarily.
Thanks!
November 3, 2016 at 9:33 am #1242422
RichWarner89ParticipantThis reply has been marked as private.November 3, 2016 at 10:35 am #1242528
RupokMemberHi there,
Thanks for writing in! So you want the transparent Navbar first and then white Navbar on on scroll?
You have the below code already :
.x-navbar.x-navbar-fixed-top { background: transparent none repeat scroll 0 0; border: medium none; box-shadow: none; }Let’s update this code to following :
.x-navbar { background: transparent none repeat scroll 0 0; border: medium none; box-shadow: none; } .x-navbar.x-navbar-fixed-top { background-color: #fff; border-bottom: 1px solid #ccc; box-shadow: 0 0.15em 0.35em 0 rgba(0, 0, 0, 0.133); }Hope this helps.
November 6, 2016 at 10:11 am #1245965
RichWarner89ParticipantThat did not work 🙁
November 6, 2016 at 11:06 am #1246026
RupokMemberHi there,
I can see this working perfectly as you wanted. Do you want the transparent Navbar back when you scroll back to top? In that case, you can add this under Custom > JavaScript in the Customizer.
jQuery(function($){ $(window).scroll(function(){ if( $(this).scrollTop() == 0 ) { $('.x-navbar-fixed-top').removeClass('x-navbar-fixed-top'); } }) });Thanks!
November 7, 2016 at 9:04 am #1247155
RichWarner89ParticipantI checked on a different computer and seams to be working. However, I would prefer the transition from transparent to solid be a fade into the white. Not just an immediate transition to white. is this possible?
November 7, 2016 at 10:15 am #1247282
JoaoModeratorHi There,
Add this to your javascript instead :
jQuery(document).ready(function($){ $('.home .x-navbar-fixed-top').css("background-color", "transparent"); $(window).scroll(function(){ if ($(this).scrollTop() > 400) { $('.home .x-navbar-fixed-top').css("background-color", "rgba(255,255,255,0.99)").css("transition","0.3s ease-in-out "); } else if ($(this).scrollTop() > 300) { $('.home .x-navbar-fixed-top').css("background-color", "rgba(255,255,255,0.75)").css("transition","0.3s ease-in-out "); } else if ($(this).scrollTop() > 200) { $('.home .x-navbar-fixed-top').css("background-color", "rgba(255,255,255,0.5)").css("transition","0.3s ease-in-out "); } else if ($(this).scrollTop() > 100) { $('.home .x-navbar-fixed-top').css("background-color", "rgba(255,255,255,0.35)").css("transition","0.3s ease-in-out "); } else { $('.home .x-navbar-fixed-top').css("background-color", "transparent").css("transition","0.3s ease-in-out "); } if ($(this).scrollTop() > 100) { $('.home .x-navbar-fixed-top').addClass('x-navbar-scrolled'); } else { $('.home .x-navbar-fixed-top').removeClass('x-navbar-scrolled'); } }); });And add this to the CSS :
.x-navbar { box-shadow: none !important; border-bottom: none !important; }Hope it helps
Joao
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1241021 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
