|
|
Line 39: |
Line 39: |
| </div> | | </div> |
| | | |
− | * {box-sizing:border-box}
| |
| | | |
− | /* Slideshow container */
| |
| .slideshow-container { | | .slideshow-container { |
| max-width: 1000px; | | max-width: 1000px; |
Line 67: |
Line 65: |
| } | | } |
| | | |
− | /* Position the "next button" to the right */
| |
| .next { | | .next { |
| right: 0; | | right: 0; |
Line 73: |
Line 70: |
| } | | } |
| | | |
− | /* On hover, add a black background color with a little bit see-through */
| + | |
| .prev:hover, .next:hover { | | .prev:hover, .next:hover { |
| background-color: rgba(0,0,0,0.8); | | background-color: rgba(0,0,0,0.8); |
| } | | } |
| | | |
− | /* Caption text */
| + | |
| .text { | | .text { |
| color: #f2f2f2; | | color: #f2f2f2; |
Line 89: |
Line 86: |
| } | | } |
| | | |
− | /* Number text (1/3 etc) */
| + | |
| .numbertext { | | .numbertext { |
| color: #f2f2f2; | | color: #f2f2f2; |
Line 98: |
Line 95: |
| } | | } |
| | | |
− | /* The dots/bullets/indicators */
| + | |
| .dot { | | .dot { |
| cursor:pointer; | | cursor:pointer; |
Line 114: |
Line 111: |
| } | | } |
| | | |
− | /* Fading animation */
| + | |
| .fade { | | .fade { |
| -webkit-animation-name: fade; | | -webkit-animation-name: fade; |
Revision as of 11:24, 27 June 2017
1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three
❮
❯
.slideshow-container {
max-width: 1000px;
position: relative;
margin: auto;
}
.mySlides {
display: none;
}
/* Next & previous buttons */
.prev, .next {
cursor: pointer;
position: absolute;
top: 50%;
width: auto;
margin-top: -22px;
padding: 16px;
color: white;
font-weight: bold;
font-size: 18px;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
}
.next {
right: 0;
border-radius: 3px 0 0 3px;
}
.prev:hover, .next:hover {
background-color: rgba(0,0,0,0.8);
}
.text {
color: #f2f2f2;
font-size: 15px;
padding: 8px 12px;
position: absolute;
bottom: 8px;
width: 100%;
text-align: center;
}
.numbertext {
color: #f2f2f2;
font-size: 12px;
padding: 8px 12px;
position: absolute;
top: 0;
}
.dot {
cursor:pointer;
height: 13px;
width: 13px;
margin: 0 2px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
transition: background-color 0.6s ease;
}
.active, .dot:hover {
background-color: #717171;
}
.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}
}
var slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("mySlides");
var dots = document.getElementsByClassName("dot");
if (n > slides.length) {slideIndex = 1}
if (n < 1) {slideIndex = slides.length}
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
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";
}