Slick: how to Customize own style of dots

Created on 19 Jan 2018  路  2Comments  路  Source: kenwheeler/slick

want to Customize dots like line ,not a circle

Most helpful comment

So what I did was that I made an array/list,
var network = ["Work","School","Family","Something"]
then I used jQuery to make my slick, and under the customPaging section I ran a function that iterates through the array as many times as there are slides ..

remember to make have enough names in array as there are sliders.

 jQuery(".network-slider").slick({
    infinite: true,
    slidesToShow: 1,
    slidesToScroll: 1,
    autoplay: false,
    autoplaySpeed: 8000,
    nextArrow: '<div class="right"><i class="fa fa-angle-right"></i></div>',
    prevArrow: '<div class="left"><i class="fa fa-angle-left"></i></div>',
    dots: true,
    customPaging: function(slider, i) {
      var name = network[i];
      return '<div class="pager__item" id=' + name + "> " + name + " </div>";
    },
    useTransform: true,
    cssEase: "ease-in-out"
  }); 

you could try with this option, didn't check if it works;

 jQuery(".network-slider").slick({
    infinite: true,
    slidesToShow: 1,
    slidesToScroll: 1,
    autoplay: false,
    autoplaySpeed: 8000,
    nextArrow: '<div class="right"><i class="fa fa-angle-right"></i></div>',
    prevArrow: '<div class="left"><i class="fa fa-angle-left"></i></div>',
    dots: true,
    customPaging: function(slider, i) {

      return '<div class="pager__item" id=' + i + "> __ </div>";
    },
    useTransform: true,
    cssEase: "ease-in-out"
  });

All 2 comments

So what I did was that I made an array/list,
var network = ["Work","School","Family","Something"]
then I used jQuery to make my slick, and under the customPaging section I ran a function that iterates through the array as many times as there are slides ..

remember to make have enough names in array as there are sliders.

 jQuery(".network-slider").slick({
    infinite: true,
    slidesToShow: 1,
    slidesToScroll: 1,
    autoplay: false,
    autoplaySpeed: 8000,
    nextArrow: '<div class="right"><i class="fa fa-angle-right"></i></div>',
    prevArrow: '<div class="left"><i class="fa fa-angle-left"></i></div>',
    dots: true,
    customPaging: function(slider, i) {
      var name = network[i];
      return '<div class="pager__item" id=' + name + "> " + name + " </div>";
    },
    useTransform: true,
    cssEase: "ease-in-out"
  }); 

you could try with this option, didn't check if it works;

 jQuery(".network-slider").slick({
    infinite: true,
    slidesToShow: 1,
    slidesToScroll: 1,
    autoplay: false,
    autoplaySpeed: 8000,
    nextArrow: '<div class="right"><i class="fa fa-angle-right"></i></div>',
    prevArrow: '<div class="left"><i class="fa fa-angle-left"></i></div>',
    dots: true,
    customPaging: function(slider, i) {

      return '<div class="pager__item" id=' + i + "> __ </div>";
    },
    useTransform: true,
    cssEase: "ease-in-out"
  });

Thank you @HaciKale, the second option worked for me.
Also, since I wanted a custom shape, I removed the underscores and styled the div using the class .pager__item then for the active state, I styled the class .slick-active .pager__item

Was this page helpful?
0 / 5 - 0 ratings

Related issues

k-lusine picture k-lusine  路  3Comments

jamesinealing picture jamesinealing  路  3Comments

jeremymandel picture jeremymandel  路  3Comments

hoghamburg picture hoghamburg  路  3Comments

xtatanx picture xtatanx  路  3Comments