Line 6: | Line 6: | ||
toggle between hiding and showing the dropdown content */ | toggle between hiding and showing the dropdown content */ | ||
function myFunction() { | function myFunction() { | ||
− | + | document.getElementById("myDropdown").classList.toggle("show"); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
− | // Close the dropdown if the user clicks | + | |
− | window.onclick = function( | + | // Close the dropdown if the user clicks outside of it |
− | + | window.onclick = function(e) { | |
− | + | if (!e.target.matches('.dropbtn')) { | |
− | + | var myDropdown = document.getElementById("myDropdown"); | |
− | + | if (myDropdown.classList.contains('show')) { | |
− | + | myDropdown.classList.remove('show'); | |
− | + | } | |
− | + | } | |
− | + | ||
− | + | ||
− | + | ||
} | } | ||
Line 335: | Line 324: | ||
<div class="dropdown"> | <div class="dropdown"> | ||
− | <button class="dropbtn" onclick="myFunction( | + | <button class="dropbtn" onclick="myFunction()">Team |
− | <div class="dropdown-content" id=" | + | <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( | + | <button class="dropbtn" onclick="myFunction()">Project |
− | <div class="dropdown-content" id=" | + | <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( | + | <button class="dropbtn" onclick="myFunction()">Parts |
− | <div class="dropdown-content" id=" | + | <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( | + | <button class="dropbtn" onclick="myFunction()">Practices |
− | <div class="dropdown-content" id=" | + | <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( | + | <button class="dropbtn" onclick="myFunction()">Awards |
− | <div class="dropdown-content" id=" | + | <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