A
A
Andrey Filimonov2017-06-09 11:27:55
css
Andrey Filimonov, 2017-06-09 11:27:55

How to make a hamburger mobile menu first indented and then fixed?

Hello, the site has a mobile menu, its stripes are fixed in the upper right corner. I added a 30 px block on top, in the desktop, when scrolling the menu, it hides it and everything is ok. And in mobile form, menu bars run into it. How to make the bars move along with the #header strip?
534de58a32ff4e5fa895849e7d92761c.png
#header is fixed by such a script

$(function(){
$(window).scroll(function() {
var top = $(document).scrollTop();
if (top < 30) $("#header").css({top: '0', position: 'relative'});
else $("#header").css({top: '0', position: 'fixed'});
});
});

but .navPanelToggle is not smart enough to apply

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Adam Sulumov, 2018-10-12
@MRcracker

SELECTOR {
     display: flex;
     align-items: center;
     justify-content: center;
}

V
Vladimir, 2018-10-12
@Bigata

For example Container do

display: flex;
flex-direction: column;
align-items: center;

put the text in an inner wrapper, for example in another div

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question