Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1015998
    speester
    Participant

    https://community.theme.co/forums/topic/jquery-sticky-header-that-shrinks-when-scrolling-down/

    I follow above and added into css and java script. i edited the values and now it looks great on desktop but on mobile. After i scroll the menu button is centralise but before scroll its not in the center, its nearer to the top. How can i make before scroll also center.

    My settings

    Mobile Navbar Button Size (px)
    18

    Mobile Navbar Button Alignment (px)
    10

    Custom CSS
    =========

    .x-navbar .desktop .x-nav > li > a, .x-navbar .x-brand, .x-navbar .x-navbar-inner {
    -webkit-transition: height 2s, padding-top 2s;
    transition: height 2s, padding-top 2s;
    }

    .x-navbar .desktop .x-nav > li > a, .x-navbar .x-brand {
    -webkit-transition: min-height 2s;
    transition: min-height 2s;
    }
    .x-navbar.x-navbar-fixed-top .desktop .x-nav > li > a {
    height: 50px;
    padding-top: 20px;
    }

    .x-navbar.x-navbar-fixed-top .x-brand {
    width: 90px;
    }

    .x-navbar.x-navbar-fixed-top .x-navbar-inner {
    min-height: 50px;
    }

    javascript
    ==========
    jQuery(function($) {

    $(window).scroll(function(){

    if($(this).scrollTop()<=0) {
    $(‘.x-navbar’).removeClass(‘x-navbar-fixed-top x-container-fluid max width’);
    }

    });

    });

    #1016000
    speester
    Participant
    This reply has been marked as private.
    #1016001
    speester
    Participant
    #1016022
    Christopher
    Moderator

    Hi there,

    Please change Mobile Navbar Button Alignment (px) value to 16px.

    Hope it helps.

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