Line 97: | Line 97: | ||
} | } | ||
</style> | </style> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<head> | <head> | ||
Line 178: | Line 160: | ||
<div class="clear extra_space"></div> | <div class="clear extra_space"></div> | ||
<div class="clear extra_space"></div> | <div class="clear extra_space"></div> | ||
+ | |||
+ | <script> | ||
+ | /* Loop through all dropdown buttons to toggle between hiding and showing its dropdown content - This allows the user to have multiple dropdowns without any conflict */ | ||
+ | var dropdown = document.getElementsByClassName("dropdown-btn"); | ||
+ | var i; | ||
+ | |||
+ | for (i = 0; i < dropdown.length; i++) { | ||
+ | dropdown[i].addEventListener("click", function() { | ||
+ | this.classList.toggle("active"); | ||
+ | var dropdownContent = this.nextElementSibling; | ||
+ | if (dropdownContent.style.display === "block") { | ||
+ | dropdownContent.style.display = "none"; | ||
+ | } else { | ||
+ | dropdownContent.style.display = "block"; | ||
+ | } | ||
+ | }); | ||
+ | } | ||
+ | </script> | ||
+ | |||
<body/> | <body/> | ||
<html/> | <html/> |
Revision as of 09:16, 26 May 2018