Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1361662
    eitanshavit
    Participant

    Hi,

    My top nav is hidden, and I’m using only the main menu (fixed) with Ethos stack.
    Currently menu background is black when on top and when I start scrolling.
    I would like the menu BG to be transparent, and when I start scrolling, bg becomes black.
    I think Icon stack has a similar behavior, but couldn’t find my way around the css files…

    Can you help?

    Thanks,

    Eitan

    #1361757
    Rahul
    Moderator

    Hi There,

    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    #1363091
    eitanshavit
    Participant
    This reply has been marked as private.
    #1363381
    Nabeel A
    Moderator

    Hi there,

    Thank you for providing the credentials. Please add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript

    jQuery(document).ready(function($){
    	$('.x-navbar-fixed-top, .x-navbar').css("background-color", "#000");
    	var navbar_height = $(".x-navbar").height();
    	$(window).scroll(function(){
    		if ($(this).scrollTop() > navbar_height) {
    			$('.x-navbar, .x-navbar-fixed-top').attr('style','background-color: transparent !important');
    		} else {
    			$('.x-navbar, .x-navbar-fixed-top').attr('style','background-color: #000 !important');
    		}
    	});
    });

    Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!

    #1363394
    eitanshavit
    Participant

    Thanks!
    Almost there 🙂
    I wanted it to start transparent, and when scrolled down, it turns to black.

    Is this possible?
    Tried to change the code, but it didn’t work….

    Thanks again.

    #1363443
    Nabeel A
    Moderator

    Hi again,

    Please replace the previous code with this:

    jQuery(document).ready(function($){
    	$('.x-navbar-fixed-top, .x-navbar').css("background-color", "transparent");
    	var navbar_height = $(".x-navbar").height();
    	$(window).scroll(function(){
    		if ($(this).scrollTop() > navbar_height) {
    			$('.x-navbar, .x-navbar-fixed-top').attr('style','background-color: #000 !important');
    		} else {
    			$('.x-navbar, .x-navbar-fixed-top').attr('style','background-color: transparent !important');
    		}
    	});
    });

    Let us know how this goes!

    #1363860
    eitanshavit
    Participant

    No. Tried that.
    It starts black, goes to transparent for a second and then back to black…

    #1363937
    Rue Nel
    Moderator

    Hello There,

    Thanks for updating in! Do you want something like this, http://prntscr.com/e6ej19 ?

    If that is the case, please edit your page in Cornerstone and insert the following custom css in the settings tab, Settings > Custom CSS

    .x-navbar {
        margin-bottom: 0;
        border: none;
    }
    
    .page-id-6622.x-navbar-fixed-top-active .x-navbar-wrap {
        height: 0;
    }

    We would loved to know if this has work for you. Thank you.

    #1364501
    eitanshavit
    Participant

    YES!
    Thank you!
    I guess I’ll need to add this code to every page with its own page ID…
    Unless there’s a global class to use.

    Thanks again,

    Eitan

    #1364574
    Rahul
    Moderator

    Glad we were able to help you.

    Feel free to ask us again.

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1361662 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>