Difference between revisions of "Team:NTHU Formosa"

Line 346: Line 346:
 
   <script>
 
   <script>
 
     function onAnchorChange() {
 
     function onAnchorChange() {
       var side = new Array(4);
+
       var side = [document.getElementById("mySide_1"), document.getElementById("mySide_2"), document.getElementById("mySide_3"), document.getElementById("mySide_4")];
      for (let i = 0; i < 4; i++) {
+
        let string = "mySide_" + i;
+
        side[i] = document.getElementById(string);
+
      }
+
      // var side1 = document.getElementById("mySide_1");
+
      // var side2 = document.getElementById("mySide_2");
+
      // var side3 = document.getElementById("mySide_3");
+
      // var side4 = document.getElementById("mySide_4");
+
 
       side[0].classList.remove(side1.classList.item(2));
 
       side[0].classList.remove(side1.classList.item(2));
 
       side[0].classList.add("instagram");
 
       side[0].classList.add("instagram");

Revision as of 04:42, 10 October 2018