Difference between revisions of "Template:BIMATOX Project"

Line 6: Line 6:
 
toggle between hiding and showing the dropdown content */
 
toggle between hiding and showing the dropdown content */
 
function myFunction() {
 
function myFunction() {
        var dropdowns = document.getElementsByCLassName("dropdown-content");
+
    document.getElementById("myDropdown").classList.toggle("show");
                var i;
+
                for (i = 0; i < dropdowns.length; i++) {
+
                        var openDropdown = dropdowns[i];
+
                        if ( dropdowns[i] != document.getElementById(id) ) {
+
                                openDropdown.classList.remove('show');
+
                        }
+
                }
+
          document.getElementById(id).classList.toggle("show");
+
 
}
 
}
// Close the dropdown if the user clicks in window.
+
 
window.onclick = function(event) {
+
// Close the dropdown if the user clicks outside of it
        if (!event.target.matches('.dropbtn')) {
+
window.onclick = function(e) {
                var dropdowns = document.getElementsByClassName("dropdown-content");
+
  if (!e.target.matches('.dropbtn')) {
                var i;
+
    var myDropdown = document.getElementById("myDropdown");
                for (i = 0; i < dropdowns.length; i++) {
+
      if (myDropdown.classList.contains('show')) {
                        var openDropdown = dropdowns[i];
+
        myDropdown.classList.remove('show');
                        if (openDropdown.classList.contains('show')) {
+
      }
                                openDropdown.classList.remove('show');
+
  }
                        }
+
                }
+
        }
+
 
}
 
}
  
Line 335: Line 324:
  
 
   <div class="dropdown">
 
   <div class="dropdown">
     <button class="dropbtn" onclick="myFunction('m1')">Team</button>
+
     <button class="dropbtn" onclick="myFunction()">Team
     <div class="dropdown-content" id="1">
+
      <i class="fa fa-caret-down"></i>
 +
    </button>
 +
     <div class="dropdown-content" id="myDropdown1">
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Team">Team</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Team">Team</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Collaborations">Collaborations</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Collaborations">Collaborations</a>
Line 343: Line 334:
  
 
   <div class="dropdown">
 
   <div class="dropdown">
     <button class="dropbtn" onclick="myFunction('m2')">Project</button>
+
     <button class="dropbtn" onclick="myFunction()">Project
     <div class="dropdown-content" id="m2">
+
      <i class="fa fa-caret-down"></i>
 +
    </button>
 +
     <div class="dropdown-content" id="myDropdown2">
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Proyect">Description</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Proyect">Description</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Proyect">Design</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Proyect">Design</a>
Line 360: Line 353:
  
 
   <div class="dropdown">
 
   <div class="dropdown">
     <button class="dropbtn" onclick="myFunction('m3')">Parts</button>
+
     <button class="dropbtn" onclick="myFunction()">Parts
     <div class="dropdown-content" id="m3">
+
      <i class="fa fa-caret-down"></i>
 +
    </button>
 +
     <div class="dropdown-content" id="myDropdown">
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Parts">Parts</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Parts">Parts</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Parts">Basic Parts</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Parts">Basic Parts</a>
Line 372: Line 367:
  
 
   <div class="dropdown">
 
   <div class="dropdown">
     <button class="dropbtn" onclick="myFunction('m4')">Practices</button>
+
     <button class="dropbtn" onclick="myFunction()">Practices
     <div class="dropdown-content" id="m4">
+
      <i class="fa fa-caret-down"></i>
 +
    </button>
 +
     <div class="dropdown-content" id="myDropdown">
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Human_Practices">Human Practices</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Human_Practices">Human Practices</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Human_Practices">Silver HP</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Human_Practices">Silver HP</a>
Line 382: Line 379:
  
 
   <div class="dropdown">
 
   <div class="dropdown">
     <button class="dropbtn" onclick="myFunction('m5')">Awards</button>
+
     <button class="dropbtn" onclick="myFunction()">Awards
     <div class="dropdown-content" id="m5">
+
      <i class="awards"></i>
 +
    </button>
 +
     <div class="dropdown-content" id="myDropdown">
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Awards">Applied Design</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Awards">Applied Design</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Awards">Entrepreneurship</a>
 
       <a href="https://2017.igem.org/Team:UChile_Biotec/Awards">Entrepreneurship</a>

Revision as of 06:34, 27 October 2017