Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <title>W3.CSS</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
- <style>
- .mySlides {display:none;}
- </style>
- <body>
- <h1 class="w3-center">Manual Slideshow</h1>
- <div class="w3-content w3-display-container">
- <img class="mySlides" src="img_snowtops.jpg" style="width:100%">
- <img class="mySlides" src="img_lights.jpg" style="width:100%">
- <img class="mySlides" src="img_mountains.jpg" style="width:100%">
- <img class="mySlides" src="img_forest.jpg" style="width:100%">
- <img src="https://upload.wikimedia.org/wikipedia/commons/d/d7/Leszno%2Culica_S%C5%82owia%C5%84ska.jpg"<img src=" height="400px" width="180px">
- <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">
- <img src="https://s-ec.bstatic.com/images/hotel/max1024x768/957/95717615.jpg"<img src=" height="400px" width="180px">
- <img src="https://upload.wikimedia.org/wikipedia/commons/1/13/PL_Leszno_Rynek.JPG"<img src=" height="400px" width="180px">
- <img src="https://portalkomunalny.pl/wp-content/uploads/2017/06/wstazki-leszno-5.jpg"<img src=" height="400px" width="180px">
- <button class="w3-button w3-red w3-display-left" onclick="plusDivs(-1)">❮</button>
- <button class="w3-button w3-red w3-display-right" onclick="plusDivs(1)">❯</button>
- </div>
- <script>
- var slideIndex = 1;
- showDivs(slideIndex);
- function plusDivs(n) {
- showDivs(slideIndex += n);
- }
- function showDivs(n) {
- var i;
- var x = document.getElementsByClassName("mySlides");
- if (n > x.length) {slideIndex = 1}
- if (n < 1) {slideIndex = x.length}
- for (i = 0; i < x.length; i++) {
- x[i].style.display = "none";
- }
- x[slideIndex-1].style.display = "block";
- }
- </script>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement