0
Guys, I downloaded this menu, I’d like you to help me, I’m learning javascript and I’d like your help. I would like to know how to open and close the menu pq has no and where to put UL LI in html
CSS
.hamburger--slider .hamburger-inner {
top: 2px; }
.hamburger--slider .hamburger-inner::before {
top: 10px;
transition-property: transform, opacity;
transition-timing-function: ease;
transition-duration: 0.2s; }
.hamburger--slider .hamburger-inner::after {
top: 20px; }
.hamburger--slider.is-active .hamburger-inner {
transform: translate3d(0, 10px, 0) rotate(45deg); }
.hamburger--slider.is-active .hamburger-inner::before {
transform: rotate(-45deg) translate3d(-5.71429px, -6px, 0);
opacity: 0; }
.hamburger--slider.is-active .hamburger-inner::after {
transform: translate3d(0, -20px, 0) rotate(-90deg); }
HTML
<div class="hamburger hamburger--slider">
<div class="hamburger-box">
<div class="hamburger-inner"></div>
</div>
</div>
JAVASCRIPT
var hamburger = document.querySelector(".hamburger");
// On click
hamburger.addEventListener("click", function() {
// Toggle class "is-active"
hamburger.classList.toggle("is-active");
// Do something else, like open/close menu
});
See if you get a light, http://www.w3schools.com/howto/howto_js_accordion.asp
– MagicHat
Possible duplicate: http://answall.com/questions/10962/problema-em-efeito-acordion-simples-em-par%C3%A1graphs/10963#10963
– Matheus Miranda
Man, you better clear up your question because it’s hard to figure that one out. It was so formulated that apparently the answer they gave is wrong. Menu "burger" is the one with the three risks () ?
– Renan Gomes