help me to autoplay
image in jquery slider ?
i watch this tutorial and try to make an image slider , for the customization i need loop this images
youtube url of slider - https://www.youtube.com/watch?v=J2HLW4A40X8&t=5s
code is given below
<!DOCTYPE html>
<html>
<head>
<title>JQSlider</title>
<style> basic styling <>
</head>
<body>
<div class="right_img">
<div class="slider-outer">
<button class="prev">
<img src="images/leftarrow.png" alt="">
</button>
<div class="slider-inner">
<img src="images/Rectangle - Copy.png" class="active">
<img src="images/Rectangle1.png">
<img src="images/Rectangle2.png">
<img src="images/Rectangle.png">
</div>
<button class="next">
<img src="images/rightarrow.png" alt="">
</button>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
<script>
$(document).ready(function(){
$('.next').on('click', function(){
var currentImg = $('.active');
var nextImg = currentImg.next();
if(nextImg.length){
currentImg.removeClass('active').css('z-index', -10);
nextImg.addClass('active').css('z-index', 10);
}
});
$('.prev').on('click', function(){
var currentImg = $('.active');
var prevImg = currentImg.prev();
if(prevImg.length){
currentImg.removeClass('active').css('z-index', -10);
prevImg.addClass('active').css('z-index', 10);
}
});
});
</script>
</body>
</html>