Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #859840

    Gnosis123
    Participant

    The admin bar and top bar are fixed to the top of my page as I want it to be but the logo/memu section slips beneath them as I scroll. I need this also to be in a fixed position.

    #859841

    Gnosis123
    Participant
    This reply has been marked as private.
    #860210

    Paul R
    Moderator

    Hi,

    Thanks for writing in!

    You can add this under Custom > CSS in the Customizer.

    
    .x-navbar.x-navbar-fixed-top {
            top: 103px;
    }
    

    Hope that helps

    #860223

    Gnosis123
    Participant

    Not quite. Navbar starts to slide up under topbar then jumps into position.

    #860382

    Paul R
    Moderator

    Hi,

    You can add this under Custom > CSS in the Customizer.

    
    .x-navbar {
         position:absolute;
         top: 103px;
         width:100%;
    }
    
    .x-navbar.x-navbar-fixed-top {
        position: fixed !important;
    }
    

    Then add this in custom > javascript box in the customizer

    
    
    jQuery(function($) {
        $(window).scroll(function(){ 
            if($(window).scrollTop() >= 0) {
                  $('.x-navbar').addClass("x-navbar-fixed-top");
            }else {
                  $('.x-navbar').removeClass("x-navbar-fixed-top");
            }
        });
    });
    

    Hope that helps.

    #860435

    Gnosis123
    Participant

    Navbar sits in place on page refresh then shoots up and hides beneath topbar as soon as scrolling begins.

    I wonder if the problem has more to do with the way I’ve fixed the topbar???

    .x-topbar{
    margin-top:-50px !important;
    padding:0px 0 5px 0!important;
    position:fixed;
    width:100%;
    }

    #860538

    Lely
    Moderator

    Hi There,

    Please also try adding the following CSS:

    .admin-bar .x-navbar-fixed-top{
        top: 84px;
    }

    Hope this helps.

    #860543

    Gnosis123
    Participant

    oooh so close. upon page refresh the navbar hangs about 20px or so too low creating a space between it and the topbar. Soon as you touch the scroll bar it jumps into perfect position.

    #860691

    Paul R
    Moderator

    Hi,

    Please change the code to this.

    
    .admin-bar .x-navbar-fixed-top{
        top: 103px;
    }
    

    Thanks

    #861370

    Gnosis123
    Participant

    It doen’t jump now when scrolled but I have a fixed gap (around 20px) between navbar and topbar. Navbar also sits about 80px or so down on the page in cornerstone covering other sections.

    #861392

    Gnosis123
    Participant
    This reply has been marked as private.
    #862005

    Rue Nel
    Moderator

    Hello There,

    Please update the custom css code and make use of this code instead:

    .admin-bar .x-navbar-fixed-top {
        top: 83px;
    }
    
    .admin-bar.logged-in .x-navbar-fixed-top {
        top: 103px;
    }

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