Template:Sifuentes04
From 2014.igem.org
(Difference between revisions)
Line 300: | Line 300: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
- | var | + | var arrayPosition = 0; |
var imgname = new Array(); | var imgname = new Array(); | ||
Line 333: | Line 333: | ||
function moveLeft() { | function moveLeft() { | ||
- | + | arrayPosition -= 1; | |
- | if ( | + | if (arrayPosition < 0) |
- | + | arrayPosition = imgname.length - 1; | |
- | changeImg( | + | changeImg(arrayPosition); |
- | changeText( | + | changeText(arrayPosition); |
- | changeTitle( | + | changeTitle(arrayPosition); |
} | } | ||
function moveRight() { | function moveRight() { | ||
- | + | arrayPosition += 1; | |
- | if ( | + | if (arrayPosition >= imgname.length) |
- | + | arrayPosition = 0; | |
- | changeImg( | + | changeImg(arrayPosition); |
- | changeText( | + | changeText(arrayPosition); |
- | changeTitle( | + | changeTitle(arrayPosition); |
} | } | ||
Revision as of 17:08, 13 January 2015