Difference between revisions of "Team:Groningen/test"

Line 1: Line 1:
 
{{Groningen}}
 
{{Groningen}}
 
 
<html>
 
<html>
  
<div class="slideshow-container">
 
  <div class="mySlides fade">
 
    <div class="numbertext">1 / 3</div>
 
    <img src="https://static.igem.org/mediawiki/2017/5/5d/Indexwepordwiki.png" style="width:100%">
 
    <div class="text">Caption Text</div>
 
  </div>
 
  
  <div class="mySlides fade">
 
    <div class="numbertext">2 / 3</div>
 
    <img src="https://static.igem.org/mediawiki/2017/b/b5/Indextruefalse.png" style="width:100%">
 
    <div class="text">Caption Two</div>
 
  </div>
 
  
  <div class="mySlides fade">
 
    <div class="numbertext">3 / 3</div>
 
    <img src="https://static.igem.org/mediawiki/2017/9/95/Indexfig2.png" style="width:100%">
 
    <div class="text">Caption Three</div>
 
  </div>
 
  
   <a class="prev" onclick="plusSlides(-1)">&#10094;</a>
+
<style>
   <a class="next" onclick="plusSlides(1)">&#10095;</a>
+
* {box-sizing:border-box}
 +
body {font-family: Verdana,sans-serif;}
 +
.mySlides {display:none}
 +
 
 +
/* Slideshow container */
 +
.slideshow-container {
 +
   max-width: 1000px;
 +
  position: relative;
 +
  margin: auto;
 +
}
 +
 
 +
/* Caption text */
 +
.text {
 +
  color: #f2f2f2;
 +
  font-size: 15px;
 +
  padding: 8px 12px;
 +
  position: absolute;
 +
  bottom: 8px;
 +
  width: 100%;
 +
  text-align: center;
 +
}
 +
 
 +
/* Number text (1/3 etc) */
 +
.numbertext {
 +
  color: #f2f2f2;
 +
  font-size: 12px;
 +
  padding: 8px 12px;
 +
  position: absolute;
 +
  top: 0;
 +
}
 +
 
 +
/* The dots/bullets/indicators */
 +
.dot {
 +
  height: 15px;
 +
  width: 15px;
 +
  margin: 0 2px;
 +
  background-color: #bbb;
 +
  border-radius: 50%;
 +
  display: inline-block;
 +
  transition: background-color 0.6s ease;
 +
}
 +
 
 +
.active {
 +
  background-color: #717171;
 +
}
 +
 
 +
/* Fading animation */
 +
.fade {
 +
  -webkit-animation-name: fade;
 +
  -webkit-animation-duration: 1.5s;
 +
  animation-name: fade;
 +
  animation-duration: 1.5s;
 +
}
 +
 
 +
@-webkit-keyframes fade {
 +
  from {opacity: .4}
 +
  to {opacity: 1}
 +
}
 +
 
 +
@keyframes fade {
 +
  from {opacity: .4}
 +
  to {opacity: 1}
 +
}
 +
 
 +
/* On smaller screens, decrease text size */
 +
@media only screen and (max-width: 300px) {
 +
  .text {font-size: 11px}
 +
}
 +
</style>
 +
</head>
 +
<body>
 +
 
 +
<h2>Automatic Slideshow</h2>
 +
<p>Change image every 2 seconds:</p>
 +
 
 +
<div class="slideshow-container">
 +
 
 +
<div class="mySlides fade">
 +
  <div class="numbertext">1 / 3</div>
 +
  <img src="https://static.igem.org/mediawiki/2017/b/b7/Indexpicture.png" style="width:100%">
 +
  <div class="text">Caption Text</div>
 +
</div>
 +
 
 +
<div class="mySlides fade">
 +
   <div class="numbertext">2 / 3</div>
 +
  <img src="https://static.igem.org/mediawiki/2017/9/95/Indexfig2.png" style="width:100%">
 +
  <div class="text">Caption Two</div>
 +
</div>
 +
 
 +
<div class="mySlides fade">
 +
  <div class="numbertext">3 / 3</div>
 +
  <img src="https://static.igem.org/mediawiki/2017/a/a3/Indexteamsytear.png" style="width:100%">
 +
  <div class="text">Caption Three</div>
 +
</div>
 +
 
 
</div>
 
</div>
 
<br>
 
<br>
  
 
<div style="text-align:center">
 
<div style="text-align:center">
   <span class="dot" onclick="currentSlide(1)"></span>
+
   <span class="dot"></span>  
   <span class="dot" onclick="currentSlide(2)"></span>
+
   <span class="dot"></span>  
   <span class="dot" onclick="currentSlide(3)"></span>
+
   <span class="dot"></span>  
 
</div>
 
</div>
 +
 +
<script>
 +
var slideIndex = 0;
 +
showSlides();
 +
 +
function showSlides() {
 +
    var i;
 +
    var slides = document.getElementsByClassName("mySlides");
 +
    var dots = document.getElementsByClassName("dot");
 +
    for (i = 0; i < slides.length; i++) {
 +
      slides[i].style.display = "none"; 
 +
    }
 +
    slideIndex++;
 +
    if (slideIndex > slides.length) {slideIndex = 1}   
 +
    for (i = 0; i < dots.length; i++) {
 +
        dots[i].className = dots[i].className.replace(" active", "");
 +
    }
 +
    slides[slideIndex-1].style.display = "block"; 
 +
    dots[slideIndex-1].className += " active";
 +
    setTimeout(showSlides, 2000); // Change image every 2 seconds
 +
}
 +
</script>
 +
 +
 +
  
  
Line 38: Line 140:
 
</div>
 
</div>
  
</body>
+
</body>
</html>
+
</html>

Revision as of 17:04, 26 October 2017


Automatic Slideshow

Change image every 2 seconds:

1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three