maybe more clear menu icon structure

This commit is contained in:
q
2016-07-09 22:36:59 +03:00
parent 4e4a174338
commit 31b99fd614
5 changed files with 55 additions and 25 deletions

View File

@@ -33,14 +33,11 @@ function hideOthers(name) {
}
}
function dropDown(name) {
dropDownHide();
document.getElementById(name).classList.toggle("show");
hideOthers('foo');
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
function dropDownHide() {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
@@ -49,6 +46,12 @@ window.onclick = function(event) {
openDropdown.classList.remove('show');
}
}
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
dropDownHide();
}
}