var galleryTop = new Swiper('.gallery-top', {
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
spaceBetween: 10,
});
var galleryThumbs = new Swiper('.gallery-thumbs', {
spaceBetween: 10,
centeredSlides: true,
slidesPerView: 'auto',
touchRatio: 0.2,
slideToClickedSlide: true,
autoplay: 2500,
autoplayDisableOnInteraction: false
});
galleryTop.params.control = galleryThumbs;
galleryThumbs.params.control = galleryTop;
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: 300px;
margin-left: auto;
margin-right: auto;
}
.swiper-slide {
background-size: cover;
background-position: center;
}
.gallery-top {
height: 80%;
width: 100%;
}
.gallery-thumbs {
height: 20%;
box-sizing: border-box;
padding: 10px 0;
}
.gallery-thumbs .swiper-slide {
width: 25%;
height: 100%;
opacity: 0.4;
}
.gallery-thumbs .swiper-slide-active {
opacity: 1;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Swiper demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.3.1/js/swiper.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.3.1/css/swiper.min.css" rel="stylesheet"/>
</head>
<body>
<!-- Swiper -->
<div class="swiper-container gallery-top">
<div class="swiper-wrapper">
<div class="swiper-slide" style="background-image:url(http://black-flag.net/devel/jQueryResponsiveFlickSlider/img/photo1.jpg)"></div>
<div class="swiper-slide" style="background-image:url(http://black-flag.net/devel/jQueryResponsiveFlickSlider/img/photo2.jpg)"></div>
<div class="swiper-slide" style="background-image:url(http://black-flag.net/devel/jQueryResponsiveFlickSlider/img/photo3.jpg)"></div>
<div class="swiper-slide" style="background-image:url(http://black-flag.net/devel/jQueryResponsiveFlickSlider/img/photo4.jpg)"></div>
<div class="swiper-slide" style="background-image:url(http://black-flag.net/devel/jQueryResponsiveFlickSlider/img/photo5.jpg)"></div>
</div>
<!-- Add Arrows -->
<div class="swiper-button-next swiper-button-white"></div>
<div class="swiper-button-prev swiper-button-white"></div>
</div>
<div class="swiper-container gallery-thumbs">
<div class="swiper-wrapper">
<div class="swiper-slide" style="background-image:url(http://black-flag.net/devel/jQueryResponsiveFlickSlider/img/photo1.jpg)"></div>
<div class="swiper-slide" style="background-image:url(http://black-flag.net/devel/jQueryResponsiveFlickSlider/img/photo2.jpg)"></div>
<div class="swiper-slide" style="background-image:url(http://black-flag.net/devel/jQueryResponsiveFlickSlider/img/photo3.jpg)"></div>
<div class="swiper-slide" style="background-image:url(http://black-flag.net/devel/jQueryResponsiveFlickSlider/img/photo4.jpg)"></div>
<div class="swiper-slide" style="background-image:url(http://black-flag.net/devel/jQueryResponsiveFlickSlider/img/photo5.jpg)"></div>
</div>
</div>
</body>
</html>