Difference between revisions of "Team:NTHU Formosa"

Line 489: Line 489:
 
     <!-- Section 0 -->
 
     <!-- Section 0 -->
 
     <div class="section " id="section0">
 
     <div class="section " id="section0">
      <p>Interactive Cell</p>
 
 
     </div>
 
     </div>
 +
 +
    <script>
 +
      window.onload = function() {
 +
 +
        let i = 0;
 +
 +
        function changeImage() {
 +
          var BackgroundImg["https://static.igem.org/mediawiki/2018/6/66/T--NTHU_Formosa--cell0.png",
 +
            "https://static.igem.org/mediawiki/2018/3/39/T--NTHU_Formosa--cell1.png",
 +
            "https://static.igem.org/mediawiki/2018/8/88/T--NTHU_Formosa--cell2.png",
 +
            "https://static.igem.org/mediawiki/2018/b/be/T--NTHU_Formosa--cell3.png",
 +
            "https://static.igem.org/mediawiki/2018/a/a3/T--NTHU_Formosa--cell4.png"
 +
          ];
 +
 +
          //document.getElementById("section0").style.property = background-image:
 +
          document.getElementById("section0").style.backgroundImage = 'url("' + BackgroundImg[i] + '")';
 +
          if (i == 5) i = 0;
 +
          else i = i + 1;
 +
        }
 +
        window.setInterval(changeImage, 3000);
 +
      }
 +
    </script>
  
 
     <!-- Section 1 -->
 
     <!-- Section 1 -->

Revision as of 19:49, 15 October 2018