Advertisement
Guest User

Andrzej

a guest
Apr 24th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <title>W3.CSS</title>
  4. <meta name="viewport" content="width=device-width, initial-scale=1">
  5. <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
  6. <style>
  7. .mySlides {display:none;}
  8. </style>
  9. <body>
  10.  
  11. <h1 class="w3-center">Manual Slideshow</h1>
  12.  
  13. <div class="w3-content w3-display-container">
  14. <img class="mySlides" src="img_snowtops.jpg" style="width:100%">
  15. <img class="mySlides" src="img_lights.jpg" style="width:100%">
  16. <img class="mySlides" src="img_mountains.jpg" style="width:100%">
  17. <img class="mySlides" src="img_forest.jpg" style="width:100%">
  18. <img src="https://upload.wikimedia.org/wikipedia/commons/d/d7/Leszno%2Culica_S%C5%82owia%C5%84ska.jpg"<img src=" height="400px" width="180px">
  19. <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Ratusz_w_Lesznie_%282%29.jpg/1200px-Ratusz_w_Lesznie_%282%29.jpg"<img src=" height="400px" width="180px">
  20. <img src="https://s-ec.bstatic.com/images/hotel/max1024x768/957/95717615.jpg"<img src=" height="400px" width="180px">
  21. <img src="https://upload.wikimedia.org/wikipedia/commons/1/13/PL_Leszno_Rynek.JPG"<img src=" height="400px" width="180px">
  22. <img src="https://portalkomunalny.pl/wp-content/uploads/2017/06/wstazki-leszno-5.jpg"<img src=" height="400px" width="180px">
  23. <button class="w3-button w3-red w3-display-left" onclick="plusDivs(-1)">&#10094;</button>
  24. <button class="w3-button w3-red w3-display-right" onclick="plusDivs(1)">&#10095;</button>
  25. </div>
  26.  
  27. <script>
  28. var slideIndex = 1;
  29. showDivs(slideIndex);
  30.  
  31. function plusDivs(n) {
  32. showDivs(slideIndex += n);
  33. }
  34.  
  35. function showDivs(n) {
  36. var i;
  37. var x = document.getElementsByClassName("mySlides");
  38. if (n > x.length) {slideIndex = 1}
  39. if (n < 1) {slideIndex = x.length}
  40. for (i = 0; i < x.length; i++) {
  41. x[i].style.display = "none";
  42. }
  43. x[slideIndex-1].style.display = "block";
  44. }
  45. </script>
  46.  
  47. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement