код в html <div class="jcarousel-wrapper mt-4">
<div class="jcarousel">
<ul>
<li class="items"><img src="img/Screenshot_26.png" alt="Image 1">
<div class="card-one">
<h4 class="card-title">Ткань,лен</h4>
</div>
</li>
<li class="items"><img src="img/Screenshot_26.png" alt="Image 2">
<div class="card-one">
<h4 class="card-title">Ткань,лен</h4>
</div>
</li>
<li class="items"><img src="img/Screenshot_26.png" alt="Image 3">
<div class="card-one">
<h4 class="card-title">Ткань,лен</h4>
</div>
</li>
<li class="items"><img src="img/Screenshot_26.png" alt="Image 4">
<div class="card-one">
<h4 class="card-title">Ткань,лен</h4>
</div>
</li>
<li class="items"><img src="img/Screenshot_26.png" alt="Image 5">
<div class="card-one">
<h4 class="card-title">Ткань,лен</h4>
</div>
</li>
<li class="items"><img src="img/Screenshot_26.png" alt="Image 6">
<div class="card-one">
<h4 class="card-title">Ткань,лен</h4>
</div>
</li>
</ul>
</div>
<a href="#" class="jcarousel-control-prev">‹</a>
<a href="#" class="jcarousel-control-next">›</a>
</div>
код css.wrapper {
max-width: 950px;
padding: 0 20px 40px 20px;
margin: auto;
}
.jcarousel-wrapper {
margin: 10px auto;
position: relative;
border: 10px solid #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 0 2px #999;
-moz-box-shadow: 0 0 2px #999;
box-shadow: 0 0 2px #999;
background: #F8F5EB;
}
/** Carousel **/
.jcarousel {
position: relative;
overflow: hidden;
width: 100%;
}
.jcarousel ul {
width: 10000em;
position: relative;
list-style: none;
margin: 0;
padding: 0;
}
.jcarousel li {
width: 250px!important;
float: left;
border: 1px solid #fff;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.jcarousel img {
display: block;
max-width: 100%;
height: auto !important;
}
/** Carousel Controls **/
.jcarousel-control-prev,
.jcarousel-control-next {
position: absolute;
top: 40%;
margin-top: -15px;
width: 30px;
height: 30px;
text-align: center;
background: #F8F5EB;
color: #fff;
text-decoration: none;
text-shadow: 0 0 1px #000;
font: 24px/27px Arial, sans-serif;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
-webkit-box-shadow: 0 0 4px #F0EFE7;
-moz-box-shadow: 0 0 4px #F0EFE7;
box-shadow: 0 0 4px #F0EFE7;
}
.jcarousel-control-prev {
left: 15px;
}
.jcarousel-control-next {
right: 15px;
}
/** Carousel Pagination **/
.jcarousel-pagination {
position: absolute;
bottom: -40px;
left: 50%;
-webkit-transform: translate(-50%, 0);
-ms-transform: translate(-50%, 0);
transform: translate(-50%, 0);
margin: 0;
}
.jcarousel-pagination a {
text-decoration: none;
display: inline-block;
font-size: 11px;
height: 10px;
width: 10px;
line-height: 10px;
background: #fff;
color: #4E443C;
border-radius: 10px;
text-indent: -9999px;
margin-right: 7px;
-webkit-box-shadow: 0 0 2px #4E443C;
-moz-box-shadow: 0 0 2px #4E443C;
box-shadow: 0 0 2px #4E443C;
}
.jcarousel-pagination a.active {
background: #4E443C;
color: #fff;
opacity: 1;
-webkit-box-shadow: 0 0 2px #F0EFE7;
-moz-box-shadow: 0 0 2px #F0EFE7;
box-shadow: 0 0 2px #F0EFE7;
}
Код JS(function($) {
$(function() {
var jcarousel = $('.jcarousel');
jcarousel
.on('jcarousel:reload jcarousel:create', function () {
var carousel = $(this),
width = carousel.innerWidth();
if (width >> 1000) {
width = width / 4;
}else if (width >= 900) {
width = width / 3;
} else if (width >= 350) {
width = width / 1;
}
carousel.jcarousel('items').css('width', Math.ceil(width) + 'px');
})
.jcarousel({
wrap: 'circular'
});
$('.jcarousel-control-prev')
.jcarouselControl({
target: '-=1'
});
$('.jcarousel-control-next')
.jcarouselControl({
target: '+=1'
});
$('.jcarousel-pagination')
.on('jcarouselpagination:active', 'a', function() {
$(this).addClass('active');
})
.on('jcarouselpagination:inactive', 'a', function() {
$(this).removeClass('active');
})
.on('click', function(e) {
e.preventDefault();
})
.jcarouselPagination({
perPage: 1,
item: function(page) {
return '<a href="#' + page + '">' + page + '</a>';
}
});
});
})(jQuery);
фото карусели