Team:Cornell/templates/header

From 2012.igem.org

(Difference between revisions)
Line 30: Line 30:
links[1]="https://2012.igem.org/Team:Cornell/Sandbox/project/wetlab";
links[1]="https://2012.igem.org/Team:Cornell/Sandbox/project/wetlab";
links[2]="somepage";
links[2]="somepage";
 +
var prev = document.getElementById("prev");
 +
var next = document.getElementById("next");
 +
for(var i=0;i<links.length;i++) {
for(var i=0;i<links.length;i++) {
if(window.location.href.toString()==links[i]) {
if(window.location.href.toString()==links[i]) {
 +
prev.style.display="block";
 +
next.style.display="block";
if(i==0) {
if(i==0) {
-
document.getElementById("prev").style.display="none";
+
prev.style.display="none";
-
document.getElementById("next").href=links[i+1];
+
next.href=links[i+1];
}
}
else if(i==links.length-1) {
else if(i==links.length-1) {
-
document.getElementById("next").style.display="none";
+
next.style.display="none";
-
document.getElementById("prev").href=links[i-1];
+
prev.href=links[i-1];
}
}
else {
else {
-
document.getElementById("prev").href=links[i-1];
+
prev.href=links[i-1];
-
document.getElementById("next").href=links[i+1];
+
next.href=links[i+1];
}
}
//here once lay a return
//here once lay a return

Revision as of 18:46, 19 June 2013