Difference between revisions of "Team:Melbourne/Project"

Line 1: Line 1:
 
{{Melbourne}}
 
{{Melbourne}}
 +
<html>
 
<html>
 
<html>
 +
  
 
<script>
 
<script>
function openCity(cityName) {
+
function openCity(cityName, elmnt, color) {
     var i;
+
    // Hide all elements with class="tabcontent" by default */
     var x = document.getElementsByClassName("city");
+
     var i, tabcontent, tablinks;
     for (i = 0; i < x.length; i++) {
+
     tabcontent = document.getElementsByClassName("tabcontent");
         x[i].style.display = "none";  
+
     for (i = 0; i < tabcontent.length; i++) {
 +
         tabcontent[i].style.display = "none";
 
     }
 
     }
     document.getElementById(cityName).style.display = "block";  
+
 
 +
    // Remove the background color of all tablinks/buttons
 +
    tablinks = document.getElementsByClassName("tablink");
 +
    for (i = 0; i < tablinks.length; i++) {
 +
        tablinks[i].style.backgroundColor = "";
 +
    }
 +
 
 +
    // Show the specific tab content
 +
     document.getElementById(cityName).style.display = "block";
 +
 
 +
    // Add the specific color to the button used to open the tab content
 +
    elmnt.style.backgroundColor = color;
 
}
 
}
 +
 +
// Get the element with id="defaultOpen" and click on it
 +
document.getElementById("defaultOpen").click();
 
</script>
 
</script>
  
  
<style>
 
.main-content{
 
padding-left:15px;
 
}
 
</style>
 
  
<head>
 
    <title>
 
        Melbourne Team Site Wiki
 
    </title>
 
  
 
 
</head>
 
  
 +
<style>
 +
/* Style the tab buttons */
 +
.tablink {
 +
    background-color: #555;
 +
    color: white;
 +
    float: left;
 +
    border: none;
 +
    outline: none;
 +
    cursor: pointer;
 +
    padding: 14px 16px;
 +
    font-size: 17px;
 +
    width: 25%;
 +
}
  
<body>
+
/* Change background color of buttons on hover */
 +
.tablink:hover {
 +
    background-color: #777;
 +
}
  
 +
/* Set default styles for tab content */
 +
.tabcontent {
 +
    color: white;
 +
    display: none;
 +
    padding: 50px;
 +
    text-align: center;
 +
}
  
<br><br><br><br><br><br>
+
/* Style each tab content individually */
<br><br><br><br><br><br>
+
#London {background-color:red;}
 +
#Paris {background-color:green;}
 +
#Tokyo {background-color:blue;}
 +
#Oslo {background-color:orange;}
 +
</style>
  
<div class="main-content">
 
  
  
<div class="w3-bar w3-black">
 
  <button class="w3-bar-item w3-button" onclick="openCity('London')">Experiment</button>
 
  <button class="w3-bar-item w3-button" onclick="openCity('Paris')">Notebook</button>
 
  <button class="w3-bar-item w3-button" onclick="openCity('Tokyo')">Attribution</button>
 
</div>
 
  
 +
<body>
 +
<br><br><br><br><br>
 +
<br><br><br><br><br>
  
 +
<button class="tablink" onclick="openCity('London', this, 'red')" id="defaultOpen">Project Overview</button>
 +
<button class="tablink" onclick="openCity('Paris', this, 'green')">Experiment</button>
 +
<button class="tablink" onclick="openCity('Tokyo', this, 'blue')">Notebook</button>
 +
<button class="tablink" onclick="openCity('Oslo', this, 'orange')">Attribution</button>
  
<div id="London" class="city">
+
<div id="London" class="tabcontent">
   <h2>Experiment</h2>
+
   <h1>Project Overview</h1>
   <p></p>
+
   <p>OVERVIEW</p>
 
</div>
 
</div>
  
<div id="Paris" class="city" style="display:none">
+
<div id="Paris" class="tabcontent">
   <h2>Notebook</h2>
+
   <h1>Experiment</h1>
   <p></p>  
+
   <p>EXP</p>  
 
</div>
 
</div>
  
<div id="Tokyo" class="city" style="display:none">
+
<div id="Tokyo" class="tabcontent">
   <h2>Attribution</h2>
+
   <h1>Notebook</h1>
   <p>.</p>
+
   <p>NB</p>
 
</div>
 
</div>
  
 +
<div id="Oslo" class="tabcontent">
 +
  <h1>Attributions</h1>
 +
  <p>ATTR</p>
 
</div>
 
</div>
 +
  
 
</body>
 
</body>
 +
</html>
  
 
</html>
 
</html>

Revision as of 12:36, 16 October 2018











Project Overview

OVERVIEW

Experiment

EXP

Notebook

NB

Attributions

ATTR

</html>