Template:Sifuentes04
From 2014.igem.org
(Difference between revisions)
Line 302: | Line 302: | ||
var arrayPosition = 0; | var arrayPosition = 0; | ||
- | var | + | var imgFeatureBox= new Array(); |
- | + | imgFeatureBox[0] = "https://static.igem.org/mediawiki/2011/c/cb/Img022.png"; | |
- | + | imgFeatureBox[1] = "https://static.igem.org/mediawiki/2014/4/4c/Featureboxdemo.jpg"; | |
- | + | imgFeatureBox[2] = "https://static.igem.org/mediawiki/2011/b/b1/Img021.png"; | |
Line 329: | Line 329: | ||
function changeImg(n) { | function changeImg(n) { | ||
var imgobj = document.getElementById('imageNumber'); | var imgobj = document.getElementById('imageNumber'); | ||
- | imgobj.src = | + | imgobj.src =imgFeatureBox[n]; |
} | } | ||
Line 335: | Line 335: | ||
arrayPosition -= 1; | arrayPosition -= 1; | ||
if (arrayPosition < 0) | if (arrayPosition < 0) | ||
- | arrayPosition = | + | arrayPosition = imgFeatureBox.length - 1; |
changeImg(arrayPosition); | changeImg(arrayPosition); | ||
Line 345: | Line 345: | ||
function moveRight() { | function moveRight() { | ||
arrayPosition += 1; | arrayPosition += 1; | ||
- | if (arrayPosition >= | + | if (arrayPosition >= imgFeatureBox.length) |
arrayPosition = 0; | arrayPosition = 0; | ||
Revision as of 17:10, 13 January 2015