New course! Every coder should learn Generative AI!
Try a free lesson0
How to move the hamburger menu with the sidebar
Hello, Does anyone know how i can move the hamburger menu container with the sidebar? The hamburger menu should move to the left. Thank you! My code: https://code.sololearn.com/Wry1mqfRL9mH/?ref=app
9 Answers
+ 1
Like this ? https://code.sololearn.com/W9V7a1HtMeaU/
+ 3
Dani Intini wrote : << Mhh.. it doesn't work what you've suggested visph. I want that when the sidebar is toggled, the hamburger menu move like 300px to the left. >>
Maybe you had put a space between the ".container" and the ".change" in the ".container.space" selector, because it worked. And if that was just that the move to the left was not enough, what to do was just to adapt the values used (-300 instead of -235) : roughly what had done KrOW ^^
+ 2
You could do something like:
.container{
position: fixed;
top: 0%;
transition: transform 250ms ease 150ms;
}
.container.change {
transform:translateX(-235px);
}
+ 1
you have to change something:
#sidebar{
/* replace right with follow*/
left: -300px;
....
}
.container{
..
/* replace margin-left with follow*/
margin-right:95%;
...
}
#sidebar.active{
/* replace right with follow */
left:0px;
}
+ 1
Thank you very much! That helped me a lot! ||Thank you both!
0
Thank you for the answer but I want the menu on the right side when the sidebar isn't active , but it should be left of the sidebar when its Active. Do you know what i mean?
0
You meant that the sidebar have to be on right side of screen but the hamburger menu have to be on left side of sidebar?
0
Mhh.. it doesn't work what you've suggested visph. I want that when the sidebar is toggled, the hamburger menu move like 300px to the left.
0
👍👍👍