Difference between revisions of "Team:NUS Singapore-A/Notebook"

Line 61: Line 61:
 
</div>
 
</div>
 
</body>
 
</body>
   
+
 
 +
 
 
<script>
 
<script>
function openCity(evt, cityName) {
+
        /***************************************************JAVASCRIPT STARTS HERE**************************************************/
    var i, tabcontent, tablinks;
+
var acc = document.getElementsByClassName("accordion");
    tabcontent = document.getElementsByClassName("tabcontent");
+
var close = document.getElementsByClassName("accordion-closer");
    for (i = 0; i < tabcontent.length; i++) {
+
var inf = document.getElementsByClassName("infographic");
        tabcontent[i].style.display = "none";
+
var i;
 +
 
 +
 
 +
for (i = 0; i < acc.length; i++) {
 +
  acc[i].addEventListener("click", function() {
 +
    /* Toggle between adding and removing the "active" class,
 +
                                    to highlight the button that controls the panel */
 +
    this.classList.toggle("active");
 +
 
 +
    /* Toggle between hiding and showing the active panel */
 +
 
 +
    var panel = this.nextElementSibling;
 +
    if (panel.style.display === "block") {
 +
      panel.style.display = "none";
 +
    } else {
 +
      panel.style.display = "block";
 
     }
 
     }
     tablinks = document.getElementsByClassName("tablinks");
+
     if (panel.style.maxHeight) {
     for (i = 0; i < tablinks.length; i++) {
+
      panel.style.maxHeight = null;
        tablinks[i].className = tablinks[i].className.replace(" active", "");
+
     } else {
 +
      panel.style.maxHeight = panel.scrollHeight + "px";
 
     }
 
     }
     document.getElementById(cityName).style.display = "block";
+
  });
     evt.currentTarget.className += " active";
+
}
 +
for (i = 0; i < close.length; i++) {
 +
  close[i].addEventListener("click", function(acc) {
 +
      
 +
    this.parentElement.previousElementSibling.classList.toggle("active");
 +
    var panel = this.parentElement;
 +
    panel.style.display = "none";
 +
     if (panel.style.maxHeight) {
 +
      panel.style.maxHeight = null;
 +
    } else {
 +
      panel.style.maxHeight = panel.scrollHeight + "px";
 +
    }
 +
  });
 
}
 
}
  
 +
//for (i = 0; i < inf.length; i++) {
 +
  inf[0].addEventListener("click", function() {
 +
 +
    acc[0].classList.toggle("active");
 +
    var panel = acc[0].nextElementSibling;
 +
    if (panel.style.display === "block") {
 +
      panel.style.display = "none";
 +
    } else {
 +
      panel.style.display = "block";
 +
    }
 +
    if (panel.style.maxHeight) {
 +
      panel.style.maxHeight = null;
 +
    } else {
 +
      panel.style.maxHeight = panel.scrollHeight + "px";
 +
    }
 +
    acc[0].scrollIntoView();
 +
  });
 +
 +
  inf[1].addEventListener("click", function() {
 +
 +
    acc[1].classList.toggle("active");
 +
    var panel = acc[1].nextElementSibling;
 +
    if (panel.style.display === "block") {
 +
      panel.style.display = "none";
 +
    } else {
 +
      panel.style.display = "block";
 +
    }
 +
    if (panel.style.maxHeight) {
 +
      panel.style.maxHeight = null;
 +
    } else {
 +
      panel.style.maxHeight = panel.scrollHeight + "px";
 +
    }
 +
    acc[1].scrollIntoView();
 +
  });
 +
 +
  inf[2].addEventListener("click", function() {
 +
 +
    acc[2].classList.toggle("active");
 +
    var panel = acc[2].nextElementSibling;
 +
    if (panel.style.display === "block") {
 +
      panel.style.display = "none";
 +
    } else {
 +
      panel.style.display = "block";
 +
    }
 +
    if (panel.style.maxHeight) {
 +
      panel.style.maxHeight = null;
 +
    } else {
 +
      panel.style.maxHeight = panel.scrollHeight + "px";
 +
    }
 +
    acc[2].scrollIntoView();
 +
  });
 +
 +
  inf[3].addEventListener("click", function() {
 +
 +
    acc[3].classList.toggle("active");
 +
    var panel = acc[3].nextElementSibling;
 +
    if (panel.style.display === "block") {
 +
      panel.style.display = "none";
 +
    } else {
 +
      panel.style.display = "block";
 +
    }
 +
    if (panel.style.maxHeight) {
 +
      panel.style.maxHeight = null;
 +
    } else {
 +
      panel.style.maxHeight = panel.scrollHeight + "px";
 +
    }
 +
    acc[3].scrollIntoView();
 +
  });
 +
 +
  inf[4].addEventListener("click", function() {
 +
 +
    acc[4].classList.toggle("active");
 +
    var panel = acc[4].nextElementSibling;
 +
    if (panel.style.display === "block") {
 +
      panel.style.display = "none";
 +
    } else {
 +
      panel.style.display = "block";
 +
    }
 +
    if (panel.style.maxHeight) {
 +
      panel.style.maxHeight = null;
 +
    } else {
 +
      panel.style.maxHeight = panel.scrollHeight + "px";
 +
    }
 +
    acc[4].scrollIntoView();
 +
  });
 +
 +
  inf[5].addEventListener("click", function() {
 +
 +
    acc[5].classList.toggle("active");
 +
    var panel = acc[5].nextElementSibling;
 +
    if (panel.style.display === "block") {
 +
      panel.style.display = "none";
 +
    } else {
 +
      panel.style.display = "block";
 +
    }
 +
    if (panel.style.maxHeight) {
 +
      panel.style.maxHeight = null;
 +
    } else {
 +
      panel.style.maxHeight = panel.scrollHeight + "px";
 +
    }
 +
    acc[5].scrollIntoView();
 +
  });
 +
//}
 +
    /***************************************************JAVASCRIPT ENDS HERE****************************************************/
 
</script>
 
</script>
 
      
 
      

Revision as of 18:45, 17 October 2018

CONNECT WITH US

Below are protocols and notebooks from three wet lab groups. Feel free to download them and take a look.

Click here to download protocols used in our wet lab.

Click here to download notebook from MONTH

Click here to download notebook from MONTH

Click here to download notebook from MONTH

Click here to download notebook from MONTH