Search code examples
slick.jsslick-lightbox

How to add navigation links (dots) to slick lightbox?


I have slick carousel and slick lightbox.

The latter has no dots or navigation links. How to add them?


Solution

  • Since lightbox using slick itself:

    1. Add dots : true to dist/slick-lightbox.js (or rebuild coffeescript)
    SlickLightbox.prototype.initSlick = function (index) {
    /* Runs slick by default, using `options.slick` if provided. If `options.slick` is a function, it gets fired instead of us initializing slick. Merges in initialSlide option. */
      var additional;
      additional = { initialSlide: index, dots:true };
      //...
    }
    
    1. Add styles to make them available
    .slick-dots {
        bottom: 0;
    }
    
    .slick-dots li button::before {
        color: #9f9f9f;
    }
    
    .slick-dots li.slick-active button::before {
        color: white;
    }