[Resolved] change height primary menu when sticky

Home Forums Support [Resolved] change height primary menu when sticky

Home Forums Support change height primary menu when sticky

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #175697
    Jasper

    In the customizer, in the element spacing section, i can set the height of the primary menu. Is there css i can use to set a different height for when the menu becomes sticky?

    #175723
    Tom
    Lead Developer
    Lead Developer

    You need to add CSS for that:

    .main-navigation.navigation-clone .main-nav ul li a {
        line-height: 60px;
    }
    #175735
    Jasper

    thanks, but i do not see any difference when the menu becomes sticky

    #175752
    Tom
    Lead Developer
    Lead Developer

    Can you link me to the site?

    #175753
    Jasper
    #175830
    Tom
    Lead Developer
    Lead Developer

    Ah, you’re not using a transition:

    .main-navigation.is_stuck .main-nav ul li a {
        line-height: 60px;
    }
    #175841
    Jasper

    that works but it has not yet the desired effect

    I managed to get the logo on the stickymenu smaller with:

    .main-navigation.is_stuck .header-image {
    height: 50px;
    }

    But there is still too much white space below the menu and i can’t get rid of it.

    Using the height setting in the element spacing setting it keeps the menu centered vertically and sizes the logo automatically to fit the available space. I was hoping to be able to set a different height for the sticky menu and that the automatic resizing of the logo and vertical centering of the menu would remain intact.
    Regards, Jasper

    #175920
    Tom
    Lead Developer
    Lead Developer

    Ah, this should be your full code:

    .main-navigation.is_stuck .main-nav > ul > li > a {
        line-height: 60px;
    }
    
    .main-navigation.is_stuck ul ul {
        top: 60px;
    }
    
    .main-navigation .sticky-logo, 
    .main-navigation .sticky-logo img {
        height: 60px;
    }
    • This reply was modified 8 years, 1 month ago by Tom.
    #175923
    Jasper

    Thanks, great!

    I changed the last part in

    .main-navigation.is_stuck .sticky-logo,
    .main-navigation.is_stuck .sticky-logo img {
    height: 60px;
    }

    Now the logo is big when menu is not sticky and changes to small when menu becomes sticky

    #175935
    Jasper

    One other thing i notice is that when the menu becomes sticky, the submenu opens in the same spot as when the menu is not sticky. It would be nice if i could get it a bit ‘higher’ so it connects to the ‘sticky’ menu bar.

    #175938
    Tom
    Lead Developer
    Lead Developer
    #175940
    Jasper

    perfect!

    #194075
    Ángel Luis Piquero

    Hi Tom!

    I’m trying to change primary menu Height when it becomes sticky using CSS you posted before, but it doesn’t work for me.
    In addition, I’m trying to make menu logo disapear when it becomes sticky too. Simply I can’t find the right CSS for this.

    Can you help me, please?

    PD: Congratulations for your great theme!

    • This reply was modified 7 years, 11 months ago by Ángel Luis Piquero.
    #194098
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Any chance you can link me to your site with the CSS added?

    #330523
    Jean-Claude

    Hello Tom

    Can you please tell me where to add this code in gp-premium –

    .main-navigation.is_stuck .main-nav > ul > li > a {
    line-height: 60px;
    }

    .main-navigation.is_stuck ul ul {
    top: 60px;
    }

    .main-navigation .sticky-logo,
    .main-navigation .sticky-logo img {
    height: 60px;
    }

Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.