Difference between revisions of "Template:BIMATOX Project"

Line 10: Line 10:
  
 
// Close the dropdown if the user clicks outside of it
 
// Close the dropdown if the user clicks outside of it
window.onclick = function(e) {
+
window.onclick = function(event) {
  if (!e.target.matches('.dropbtn')) {
+
        if (!event.target.matches('.dropbtn')) {
    var myDropdown = document.getElementById("myDropdown");
+
                var dropdowns = document.getElementsByClassName("dropdown-content");
      if (myDropdown.classList.contains('show')) {
+
                var i;
        myDropdown.classList.remove('show');
+
                for (i = 0; i < dropdowns.length; i++) {
      }
+
                        var openDropdown = dropdowns[i];
  }
+
                        if (openDropdown.classList.contains('show')) {
}
+
                                openDropdown.classList.remove('show');
  
 
</script>
 
</script>

Revision as of 06:08, 27 October 2017