Difference between revisions of "Team:UCL/Bactoman"

Line 5: Line 5:
  
 
<script type="text/JavaScript">
 
<script type="text/JavaScript">
 
 
/* Here you make an array with all the URL's of the images you would like to have in your slideshow.*/
 
  
 
var image = new Array("https://static.igem.org/mediawiki/2015/8/8d/UCLbactoman1.png", "https://static.igem.org/mediawiki/2015/9/92/UCLbactoman2.png",  
 
var image = new Array("https://static.igem.org/mediawiki/2015/8/8d/UCLbactoman1.png", "https://static.igem.org/mediawiki/2015/9/92/UCLbactoman2.png",  
 
"https://static.igem.org/mediawiki/2015/a/af/Uclbactoman3.png", "https://static.igem.org/mediawiki/2015/f/fb/Uclbactoman4.png")
 
"https://static.igem.org/mediawiki/2015/a/af/Uclbactoman3.png", "https://static.igem.org/mediawiki/2015/f/fb/Uclbactoman4.png")
 
 
var imgNumber=1
 
var imgNumber=1
 
/* This number is used to refer to a value of the Array and to know what image should be shown next. */
 
 
 
 
var numberOfImg = image.length
 
var numberOfImg = image.length
  
/* This is the total amount of images you use, it is used to determine if the imgNumber can still grow. */
 
 
 
/* Now it's time to make the functions for the next and previous buttons */
 
  
 
function previousImage(){
 
function previousImage(){
Line 28: Line 16:
 
     imgNumber--
 
     imgNumber--
 
     }
 
     }
 
/* The if statement is used to know if you aren't already at the first image, because if you are, imgNumber may not decrease. */
 
 
 
   else{
 
   else{
 
   imgNumber = numberOfImg
 
   imgNumber = numberOfImg
}
+
}
+
/* If you already are at the first image, and you click the previous button, the slideshow must show the last image. */
+
 
+
  
 
   document.slideImage.src = image[imgNumber-1]
 
   document.slideImage.src = image[imgNumber-1]
 
+
    }
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
+
  
 
  }
 
 
function nextImage(){
 
function nextImage(){
 
   if(imgNumber < numberOfImg){
 
   if(imgNumber < numberOfImg){
Line 49: Line 28:
 
     }
 
     }
 
 
/* The if statement is used to know if you aren't already at the last image, because if you are, imgNumber may not increase. */
 
 
 
   else{
 
   else{
 
   imgNumber = 1
 
   imgNumber = 1
 
}
 
}
 
/* If you already are at the last image, and you click the next button, the slideshow must show the first image. */
 
 
 
 
   document.slideImage.src = image[imgNumber-1]
 
   document.slideImage.src = image[imgNumber-1]
 
 
/* Load the image into the document. Don't forget to write imgNumber-1, an array always starts from 0! */
 
 
 
 
   }
 
   }
 
    
 
    
 
 
/* Now it is time for the code that preloads the images. */
 
 
/* Check if your browser supports the Image Object. */
 
 
 
if(document.images){
 
if(document.images){
 
 
  /* Create a new Image Object. */
 
 
 
 
   var image1 = new Image()
 
   var image1 = new Image()
 
 
 
 
  /* Give the source of the image to the Image Object. */
 
 
 
 
   image1.src = "https://static.igem.org/mediawiki/2015/8/8d/UCLbactoman1.png"
 
   image1.src = "https://static.igem.org/mediawiki/2015/8/8d/UCLbactoman1.png"
 
 
 
 
  /* Repeat this for all the images you would like to preload.
 
 
 
  Make sure that you do not preload too many images, this will make your document load slow. */
 
 
   var image2 = new Image()
 
   var image2 = new Image()
 
   image2.src = "/learn/javascript/Apple.jpg"
 
   image2.src = "/learn/javascript/Apple.jpg"
Line 488: Line 439:
  
  
<table>
+
<img name="https://static.igem.org/mediawiki/2015/8/8d/UCLbactoman1.png" name="slideImage"></td>
<tr>
+
<a href="JavaScript:previousImage()">Previous</a></td><td><a href="JavaScript:nextImage()">Next</a></td>
<td> <img name="https://static.igem.org/mediawiki/2015/8/8d/UCLbactoman1.png" name="slideImage"></td>
+
 
</tr>
+
<tr>
+
<td><a href="JavaScript:previousImage()">Previous</a></td><td><a href="JavaScript:nextImage()">Next</a></td>
+
</tr>
+
</table>
+
  
  

Revision as of 20:38, 31 October 2015

'

Bactoman is a comic aimed to introduce our project to a younger audience. Set in a dystopian future where the mentally ill are excommunicated and abandoned by the society, Nathan Navaro takes the mantle of Bactoman to challenge the broken society. Bactoman utilises synthetic biology to help people with mental disorders!

PreviousNext