Team:Uppsala/Templates/TselectTier3

From 2014.igem.org

(Difference between revisions)
Line 21: Line 21:
{
{
document.getElementById("currentH").innerHTML = "Adhesion";
document.getElementById("currentH").innerHTML = "Adhesion";
-
createA("Adhesion1", "#", "tab1");
+
createA("Adhesion1", "#", "tab1", "https://static.igem.org/mediawiki/2014/e/e1/Uppsala_igem2014_AdhesionV1.png");
-
createA("Adhesion2", "#", "tab2");
+
createA("Adhesion2", "#", "tab2", "https://static.igem.org/mediawiki/2014/e/e1/Uppsala_igem2014_AdhesionV1.png");
-
createA("Adhesion3", "#", "tab3");
+
createA("Adhesion3", "#", "tab3", "https://static.igem.org/mediawiki/2014/e/e1/Uppsala_igem2014_AdhesionV1.png");
-
createA("Adhesion4", "#", "tab4");
+
createA("Adhesion4", "#", "tab4", "https://static.igem.org/mediawiki/2014/e/e1/Uppsala_igem2014_AdhesionV1.png");
changeContent("tab1");
changeContent("tab1");
changeContent("tab2");
changeContent("tab2");
Line 104: Line 104:
-
function createA(text, link, title) {
+
function createA(text, link, title, img) {
var node = document.createElement("li");
var node = document.createElement("li");
var a = document.createElement('a');
var a = document.createElement('a');
 +
                        var button = document.createElement("img");
 +
                        button.src = image;
 +
                        button.setAttribute("height", "120");
 +
                        button.setAttribute("width", "120");
var linkText = document.createTextNode(text);
var linkText = document.createTextNode(text);
-
a.appendChild(linkText);
+
a.appendChild(button);
 +
                        a.appendChild(linkText);
a.href = link;
a.href = link;
-
a.title = title
+
a.title = title;
node.appendChild(a);
node.appendChild(a);
document.getElementById("tabSection").appendChild(node);
document.getElementById("tabSection").appendChild(node);
 +
}
}

Revision as of 09:31, 21 July 2014