I’d use slick
for this. I wrote up an example on how to use it.
$(document).ready(function(){
$('.slider').slick({
infinite: true,
arrows:true
});
$("#final").click(function () {
console.log("Current slides:");
console.log($('.slide1').slick('slickCurrentSlide'));
console.log($('.slide2').slick('slickCurrentSlide'));
console.log($('.slide3').slick('slickCurrentSlide'));
});
});
body {
background:black;
}
.sliderContainer {
padding:40px;
color:white;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.js"></script>
<div class="sliderContainer">
<div class="slider slide3">
<div>your content1</div>
<div>your content2</div>
<div>your content3</div>
</div>
<div class="slider slide2">
<div>your content1</div>
<div>your content2</div>
<div>your content3</div>
</div>
<div class="slider slide1">
<div>your content1</div>
<div>your content2</div>
<div>your content3</div>
</div>
</div>
<button id="final">Finalize</button>
solved Looking for a jQuery Slider with 3 Lines [closed]