When I load the website the hamburger menu is open and closes immediately
Hey. I am following Kevin's Responsive navbar tutorial using HTML CSS & JS. Everything works except when I add
transition: transform 350ms ease-in
to .primary-navigation when I load the website at width below 800px/resize it below 800px of width, the hamburger menu is open and it immediately closes: https://zakazkolcow.pl/ What am I missing?
The code of the header is here: https://codepen.io/Iga-the-sasster/pen/poGryBYZakaz Kolców
Nasza misja to ochrona dzikich ptaków i zachowanie środowiska naturalnego.
2 Replies
normally a user won't just resize the window after page load, but if you want you could use js to temporarily disable the transition.
add to JS
add to CSS
as soon as the window detects a resize, it adds the class to set the transition to none.
after 500ms it will be set back to normal.
It worked like a charm. Thank you! 😊