Hello! I have a slide that works normally. But I have to keep passing the link of each image to him.
What I wanted to do is to put a folder path to identify the files in png or jpg and display them automatically with javascript.
The code looks like this:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.7/css/swiper.min.css">
<style>
html, body {
position: relative;
height: 100%;
}
body {
background: #000;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color:#000;
margin: 0;
padding: 0;
}
.swiper-container {
width: 100%;
height: 100%;
}
.swiper-slide {
overflow: hidden;
}
</style>
</head>
<body>
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="swiper-zoom-container">
<img src="http://lorempixel.com/800/800/sports/1/"></div></div><divclass="swiper-slide">
<div class="swiper-zoom-container">
<img src="http://lorempixel.com/800/400/sports/2/"></div></div><divclass="swiper-slide">
<div class="swiper-zoom-container">
<img src="http://lorempixel.com/400/800/sports/3/"></div></div></div><divclass="swiper-pagination swiper-pagination-white"></div>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.0.7/js/swiper.min.js"></script>
<script>
var swiper = new Swiper('.swiper-container', {
zoom: true,
pagination: {
el: '.swiper-pagination',
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
</script>