Template:Sifuentes04
From 2014.igem.org
(Difference between revisions)
Line 287: | Line 287: | ||
- | <!-- javascript for the featurebox --> | + | <!-- javascript for the featurebox --> |
- | <script type="text/javascript"> | + | <script type="text/javascript"> |
- | + | var galimgn = 0; | |
- | + | var imgname = new Array(); | |
- | + | imgname[0] = "https://static.igem.org/mediawiki/2011/c/cb/Img022.png"; | |
- | + | imgname[1] = "https://static.igem.org/mediawiki/2014/4/4c/Featureboxdemo.jpg"; | |
- | + | imgname[2] = "https://static.igem.org/mediawiki/2011/b/b1/Img021.png"; | |
- | + | var textFeatureBox = new Array(); | |
- | + | textFeatureBox[0] = "text 01"; | |
- | + | textFeatureBox[1] = "text 02"; | |
- | + | textFeatureBox[2] = "text 03"; | |
- | function changeText(n) { | + | function changeText(n) { |
- | + | var imgtext = textFeatureBox[n]; | |
- | + | document.getElementById("featureText").innerHTML = imgtext; | |
- | } | + | } |
- | function changeImg(n) { | + | function changeImg(n) { |
- | + | var imgobj = document.getElementById('galImg'); | |
- | + | imgobj.src = imgname[n]; | |
- | } | + | } |
- | function moveLeft() | + | function moveLeft() { |
- | { | + | galimgn -= 1; |
- | + | if (galimgn < 0) | |
- | + | galimgn = imgname.length - 1; | |
- | + | changeImg(galimgn); | |
- | + | changeText(galimgn); | |
- | changeText(galimgn); | + | } |
- | } | + | |
- | function moveRight() | + | |
- | { | + | function moveRight() { |
- | + | galimgn += 1; | |
- | + | if (galimgn >= imgname.length) | |
- | + | galimgn = 0; | |
- | + | changeImg(galimgn); | |
- | changeText(galimgn); | + | changeText(galimgn); |
- | } | + | } |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
+ | </script> | ||
- | <!-- jquery --> | + | <!-- jquery --> |
<script ="text/javascript"> | <script ="text/javascript"> |
Revision as of 16:05, 13 January 2015