Difference between revisions of "Team:NYU-AD"
Line 14: | Line 14: | ||
} | } | ||
− | + | .figure{ | |
− | position: | + | position:relative; |
− | + | width:90%; | |
− | + | ||
− | + | margin:auto; | |
− | + | padding:15px; | |
− | + | padding-left:03%; | |
− | + | padding-right:03%; | |
− | + | background:#F8F8F8; | |
− | + | border-style:solid; | |
− | + | border-color:#3c948b; | |
− | + | border-width:2px; | |
− | + | border-radius:10px; | |
− | + | ||
− | + | ||
− | + | ||
} | } | ||
− | |||
+ | </style> | ||
+ | <div class="figure"> | ||
<div onload = "startTimer()"> | <div onload = "startTimer()"> | ||
<div class="RotateImg"> | <div class="RotateImg"> | ||
<img id="theImage" src="https://static.igem.org/mediawiki/2015/b/bf/NYU_AD_GropuPhoto2.jpg" alt="" /> | <img id="theImage" src="https://static.igem.org/mediawiki/2015/b/bf/NYU_AD_GropuPhoto2.jpg" alt="" /> | ||
− | |||
</div> | </div> | ||
<button type="button" onclick="displayPreviousImage()">Previous</button> | <button type="button" onclick="displayPreviousImage()">Previous</button> | ||
<button type="button" onclick="displayNextImage()">Next</button> | <button type="button" onclick="displayNextImage()">Next</button> | ||
<br><br> | <br><br> | ||
− | < | + | </div> |
− | + | ||
</div> | </div> | ||
</div> | </div> | ||
Line 50: | Line 46: | ||
function displayNextImage() { | function displayNextImage() { | ||
console.log("Display next image"); | console.log("Display next image"); | ||
− | x = (x === images.length - 1) ? 0 : x + 1; | + | x = (x === images.length-1 ) ? 0 : x + 1; |
document.getElementById("theImage").src = images[x]; | document.getElementById("theImage").src = images[x]; | ||
} | } | ||
Line 62: | Line 58: | ||
function startTimer() { | function startTimer() { | ||
console.log("Starting timer!"); | console.log("Starting timer!"); | ||
− | setInterval(displayNextImage, | + | setInterval(displayNextImage, 1000); |
} | } | ||
var images = [], x = -1; | var images = [], x = -1; | ||
images[0] = "https://static.igem.org/mediawiki/2015/2/2a/RotateImg2.jpg"; | images[0] = "https://static.igem.org/mediawiki/2015/2/2a/RotateImg2.jpg"; | ||
− | + | images[1] = "https://static.igem.org/mediawiki/2015/b/bf/NYU_AD_GropuPhoto2.jpg"; | |
− | images[2] = "https://static.igem.org/mediawiki/2015/ | + | images[2] = "https://static.igem.org/mediawiki/2015/1/17/RotateImg3.jpg"; |
+ | |||
console.log("Loaded!"); | console.log("Loaded!"); |
Revision as of 00:31, 18 September 2015