dropdown menu, and fixes

This commit is contained in:
ville rantanen
2016-07-04 13:20:20 +03:00
parent c7abca9659
commit 7423f672d7
7 changed files with 77 additions and 7 deletions

View File

@@ -28,3 +28,21 @@ function hidetoggle(name) {
}}
}
}
function dropDown() {
document.getElementById("Dropdown").classList.toggle("show");
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}