Advertisement
danine1

backup slider

Dec 10th, 2019
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.03 KB | None | 0 0
  1. <style>
  2. * {box-sizing: border-box}
  3. body {font-family: Verdana, sans-serif; margin:0}
  4. .mySlides {display: none}
  5. img {vertical-align: middle;}
  6.  
  7. /* Slideshow container */
  8. .slideshow-container {
  9.   max-width: 1000px;
  10.   position: relative;
  11.   margin: auto;
  12. }
  13.  
  14. /* Next & previous buttons */
  15. .prev, .next {
  16.  cursor: pointer;
  17.   position: absolute;
  18.   top: 50%;
  19.   width: auto;
  20.   padding: 16px;
  21.   margin-top: -22px;
  22.   color: white;
  23.   font-weight: bold;
  24.   font-size: 18px;
  25.   transition: 0.6s ease;
  26.   border-radius: 0 3px 3px 0;
  27.   user-select: none;
  28. }
  29.  
  30. /* Position the "next button" to the right */
  31. .next {
  32.   right: 0;
  33.   border-radius: 3px 0 0 3px;
  34. }
  35.  
  36. /* On hover, add a black background color with a little bit see-through */
  37. .prev:hover, .next:hover {
  38.   background-color: rgba(0,0,0,0.8);
  39. }
  40.  
  41. /* Caption text */
  42. .text {
  43.   color: #f2f2f2;
  44.   font-size: 15px;
  45.   padding: 8px 12px;
  46.   position: absolute;
  47.   bottom: 8px;
  48.   width: 100%;
  49.   text-align: center;
  50. }
  51.  
  52. /* Number text (1/3 etc) */
  53. .numbertext {
  54.   color: #f2f2f2;
  55.   font-size: 12px;
  56.   padding: 8px 12px;
  57.   position: absolute;
  58.   top: 0;
  59. }
  60.  
  61. /* The dots/bullets/indicators */
  62. .dot {
  63.   cursor: pointer;
  64.   height: 15px;
  65.   width: 15px;
  66.   margin: 0 2px;
  67.   background-color: #bbb;
  68.   border-radius: 50%;
  69.   display: inline-block;
  70.   transition: background-color 0.6s ease;
  71. }
  72.  
  73. .active, .dot:hover {
  74.   background-color: #717171;
  75. }
  76.  
  77. /* Fading animation */
  78. .fade {
  79.   -webkit-animation-name: fade;
  80.   -webkit-animation-duration: 1.5s;
  81.   animation-name: fade;
  82.   animation-duration: 1.5s;
  83. }
  84.  
  85. @-webkit-keyframes fade {
  86.   0%{
  87.     opacity:0;
  88.     -webkit-transform:translateX(200px);
  89.     transform:translateX(200px)
  90.   }
  91.   100%{
  92.     opacity:1;
  93.     -webkit-transform:translateX(0);
  94.     transform:translateX(0)
  95.   }
  96. }
  97.  
  98. @keyframes fade {
  99.   0%{
  100.     opacity:0;
  101.     -webkit-transform:translateX(200px);
  102.     transform:translateX(200px)
  103.   }
  104.   100%{
  105.     opacity:1;
  106.     -webkit-transform:translateX(0);
  107.     transform:translateX(0)
  108.   }
  109. }
  110.  
  111. /* On smaller screens, decrease text size */
  112. @media only screen and (max-width: 300px) {
  113.   .prev, .next,.text {font-size: 11px}
  114. }
  115. </style>
  116. </head>
  117. <body>
  118.  
  119. <div class="slideshow-container">
  120.  
  121. <div class="mySlides fade">
  122.   <div class="numbertext">1 / 3</div>
  123.   <img src="img_nature_wide.jpg" style="width:100%">
  124.   <div class="text">Caption Text</div>
  125. </div>
  126.  
  127. <div class="mySlides fade">
  128.   <div class="numbertext">2 / 3</div>
  129.   <img src="img_snow_wide.jpg" style="width:100%">
  130.   <div class="text">Caption Two</div>
  131. </div>
  132.  
  133. <div class="mySlides fade">
  134.   <div class="numbertext">3 / 3</div>
  135.   <img src="img_mountains_wide.jpg" style="width:100%">
  136.   <div class="text">Caption Three</div>
  137. </div>
  138.  
  139. <a class="prev" onclick="plusSlides(-1)">&#10094;</a>
  140. <a class="next" onclick="plusSlides(1)">&#10095;</a>
  141.  
  142. </div>
  143. <br>
  144.  
  145. <div style="text-align:center">
  146.   <span class="dot" onclick="currentSlide(1)"></span>
  147.   <span class="dot" onclick="currentSlide(2)"></span>
  148.   <span class="dot" onclick="currentSlide(3)"></span>
  149. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement