Team:Uppsala/Templates/TselectTier2

From 2014.igem.org

(Difference between revisions)
 
(99 intermediate revisions not shown)
Line 2: Line 2:
<div id="tab_selector">
<div id="tab_selector">
-
                   <ul id="tabs">
+
                   <ul id="tabSection">
-
                    <li><a href="#" title="tab1">One</a></li>
+
-
                    <li><a href="#" title="tab2">Two</a></li>
+
-
                    <li><a href="#" title="tab3">Three</a></li>
+
-
                    <li><a href="#" title="tab4">Four</a></li>
+
                   </ul>
                   </ul>
             </div>   
             </div>   
 +
<script>
 +
var data = window.location.href;
 +
var List = document.getElementById("links");
-
          <div id="section_selector">
+
if (data.search("Project") !== -1)
 +
{
 +
document.getElementById("currentH").innerHTML = "Project";
 +
                        createA("https://2014.igem.org/Team:Uppsala/Project_Sensing", "https://static.igem.org/mediawiki/2014/2/2c/Uppsala_igem2014_SensingV2.png");
 +
createA("https://2014.igem.org/Team:Uppsala/Project_Targeting", "https://static.igem.org/mediawiki/2014/5/55/Uppsala_igem2014_TargetingV2.png");
 +
createA("https://2014.igem.org/Team:Uppsala/Project_Killing", "https://static.igem.org/mediawiki/2014/c/c7/Uppsala_igem2014_KillingV2.png");
 +
createA("https://2014.igem.org/Team:Uppsala/Project_Adhesion", "https://static.igem.org/mediawiki/2014/d/d4/Uppsala-igem2014Adhesion_labe.png");
 +
createA("https://2014.igem.org/Team:Uppsala/Project_Notebook", "https://static.igem.org/mediawiki/2014/8/82/Uppsala-igem2014Notebook.png");
 +
                        $('#header').css('background-image', 'url(https://static.igem.org/mediawiki/2014/7/76/Uppsala_iGEM2014_Team_headerPro_new.png)');
 +
                        var myNode = document.getElementById("imgwrapNH");
 +
                        while (myNode.firstChild) {
 +
                        myNode.removeChild(myNode.firstChild);
 +
                        }
 +
}
 +
else if (data.search("Modeling")!== -1)
 +
{
 +
document.getElementById("currentH").innerHTML = '<img style="width:15%" src="https://static.igem.org/mediawiki/2014/c/c1/Uppsala2014_Modeling.png"> Modeling';
 +
createA("https://2014.igem.org/Team:Uppsala/Modeling_CellCellInteraction", "https://static.igem.org/mediawiki/2014/a/af/Uppsala2014_Cell-Cell_interaction.png");
 +
createA("https://2014.igem.org/Team:Uppsala/Modeling_PopulationLevel", "https://static.igem.org/mediawiki/2014/a/a2/Uppsala2014_Population_level.png");
 +
                        $('#header').css('background-image', 'url(https://static.igem.org/mediawiki/2014/3/3e/Uppsala_iGEM2014_Team_Mod.png)');
 +
var myNode = document.getElementById("imgwrapNH");
 +
while (myNode.firstChild) {
 +
    myNode.removeChild(myNode.firstChild);
 +
}
-
          <div id="tab1">One - content</div>
+
}
-
    <div id="tab2">Two - content</div>
+
-
    <div id="tab3">Three - content</div>
+
-
    <div id="tab4">Four - content</div>
+
 +
else if (data.search("Policy")!== -1)
 +
{
 +
document.getElementById("currentH").innerHTML = "Policy & Practices";
 +
createA("https://2014.igem.org/Team:Uppsala/PolicyPractices_MicrobialDesigns", "https://static.igem.org/mediawiki/2014/0/0a/Uppsala2014_Microbial_Designs.png");
 +
createA("https://2014.igem.org/Team:Uppsala/PolicyPractices_Outreach", "https://static.igem.org/mediawiki/2014/7/78/Uppsala2014_Outreach.png");
 +
createA("https://2014.igem.org/Team:Uppsala/PolicyPractices_BusinessPlan", "https://static.igem.org/mediawiki/2014/a/a8/Uppsala2014_Buisness_plan.png");
 +
                        $('#header').css('background-image', 'url(https://static.igem.org/mediawiki/2014/f/fd/Uppsala_iGEM2014_Team_HP.png)');
-
</div>
+
var myNode = document.getElementById("imgwrapNH");
 +
while (myNode.firstChild) {
 +
    myNode.removeChild(myNode.firstChild);
 +
}
 +
}
-
<script>
+
else if (data.search("Team") !== -1)
 +
{
 +
document.getElementById("currentH").innerHTML = "Team";
 +
createA("https://2014.igem.org/Team:Uppsala/Team_SensingGroup", "https://static.igem.org/mediawiki/2014/2/2c/Uppsala_igem2014_SensingV2.png");
 +
                        createA("https://2014.igem.org/Team:Uppsala/Team_TargetingGroup", "https://static.igem.org/mediawiki/2014/5/55/Uppsala_igem2014_TargetingV2.png");
 +
createA("https://2014.igem.org/Team:Uppsala/Team_KillingGroup", "https://static.igem.org/mediawiki/2014/c/c7/Uppsala_igem2014_KillingV2.png");
 +
createA("https://2014.igem.org/Team:Uppsala/Team_AdhesionGroup", "https://static.igem.org/mediawiki/2014/d/d4/Uppsala-igem2014Adhesion_labe.png");
 +
createA("https://2014.igem.org/Team:Uppsala/Team_ModelingGroup", "https://static.igem.org/mediawiki/2014/5/51/Uppsala-igem2014Modelinglabe.png");
-
$(document).ready(function() {
+
}
-
    $("#section_selector div").hide(); // Initially hide all content
+
else
-
    $("#tabs li:first").attr("id","current"); // Activate first tab
+
{
-
    $("#section_selector div:first").fadeIn(); // Show first tab content
+
alert("Sorry something failed");
-
   
+
}
-
    $('#tabs a').click(function(e) {
+
-
        e.preventDefault();      
+
-
        $("#section_selector div").hide(); //Hide all content
+
function createA(link, image) { <!-- a "text" element can be added here -->
-
        $("#tabs li").attr("id",""); //Reset id's
+
var node = document.createElement("li");
-
        $(this).parent().attr("id","current"); // Activate this
+
var a = document.createElement('a');
-
        $('#' + $(this).attr('title')).fadeIn(); // Show content for current tab
+
                        var button = document.createElement("img");
-
    });
+
                        button.src = image;
-
})();
+
                        button.setAttribute("height", "157");
-
 
+
                        button.setAttribute("width", "157");
-
</script>
+
<!-- var linkText = document.createTextNode(text); (not needed if text is incorporated in button) --->
 +
                        a.appendChild(button);
 +
                        <!-- a.appendChild(linkText); (not needed if text is incorporated in button) --->
 +
a.href = link;
 +
node.appendChild(a);
 +
document.getElementById("tabSection").appendChild(node);                
 +
}
 +
 +
</script>
 +
         
</html>
</html>

Latest revision as of 21:23, 16 October 2014