Slick Slider Custom paging

In this example below you will see how to do a Slick Slider Custom paging with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by olejan, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright olejan ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Slick Slider Custom paging</title>
  
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">

  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <section class="regular">
	<div>
		<img src="http://placehold.it/350x300?text=1">
	</div>
	<div>
		<img src="http://placehold.it/350x300?text=2">
	</div>
	<div>
		<img src="http://placehold.it/350x300?text=3">
	</div>
	<div>
		<img src="http://placehold.it/350x300?text=4">
	</div>
	<div>
		<img src="http://placehold.it/350x300?text=5">
	</div>
	<div>
		<img src="http://placehold.it/350x300?text=6">
	</div>
</section>
<ul id="slick-dots-test">
	<li><a href="#">1</a></li>
	<li><a href="#">2</a></li>
	<li><a href="#">3</a></li>
	<li><a href="#">4</a></li>
	<li><a href="#">5</a></li>
	<li><a href="#">6</a></li>
</ul>
  <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script src='https://cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/olejan/slick-slider-custom-paging-aJaWpX */
/* Slider */
.slick-slider {
  position: relative;
  display: block;
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.slick-list {
  position: relative;
  overflow: hidden;
  display: block;
  margin: 0;
  padding: 0;
}
.slick-list:focus {
  outline: none;
}
.slick-list.dragging {
  cursor: pointer;
  cursor: hand;
}

.slick-slider .slick-track,
.slick-slider .slick-list {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

.slick-track {
  position: relative;
  left: 0;
  top: 0;
  display: block;
}
.slick-track:before, .slick-track:after {
  content: "";
  display: table;
}
.slick-track:after {
  clear: both;
}
.slick-loading .slick-track {
  visibility: hidden;
}

.slick-slide {
  float: left;
  height: 100%;
  min-height: 1px;
  padding: 0 5px;
  display: none;
}
[dir="rtl"] .slick-slide {
  float: right;
}
.slick-slide img {
  display: block;
  width: 100%;
  height: auto;
}
.slick-slide.slick-loading img {
  display: none;
}
.slick-slide.dragging img {
  pointer-events: none;
}
.slick-initialized .slick-slide {
  display: block;
}
.slick-loading .slick-slide {
  visibility: hidden;
}
.slick-vertical .slick-slide {
  display: block;
  height: auto;
  border: 1px solid transparent;
}

.slick-arrow.slick-hidden {
  display: none;
}

#slick-dots-test {
  display: flex;
  list-style: none;
}
#slick-dots-test li {
  padding: 2px;
}
#slick-dots-test a {
  display: inline-block;
  background: #000;
  color: #fff;
  padding: 5px 8px;
  text-decoration: none;
}


/*Downloaded from https://www.codeseek.co/olejan/slick-slider-custom-paging-aJaWpX */
if ($(".regular").length) {
	$(".regular").slick({
		dots: true,
		infinite: true,
		slidesToShow: 3,
		slidesToScroll: 1,
		customPaging: function(slider, i) {
			var tittle = $(slider.$slides[i]).data('slidertitle');
			if(tittle.length){
				return '<a>' + tittle + '</a>';
			}
		  }
	});
}

Comments