Last active
June 22, 2019 20:26
-
-
Save kasper573/8166679b916690af5f177f13a729c1f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let slide = document.querySelectorAll('.slideUp'); | |
slide.forEach(function (el) { | |
el.addEventListener('click', function () { | |
let parent = el.parentElement; | |
let links = parent.querySelectorAll('.link'); | |
let rotationTranform = 'rotate(45deg)'; | |
let isRotated = el.style.transform === rotationTranform; | |
if (!isRotated) { | |
el.style.transform = rotationTransform; | |
} else { | |
el.style.transform = ''; | |
} | |
links.forEach(function (link) { | |
link.classList.toggle('hidden'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment