mreq / slick-lightbox

A lightbox wrapper for Ken's amazing slick carousel.
http://mreq.github.io/slick-lightbox/
MIT License
229 stars 103 forks source link

Open lightBox on click of button #66

Closed ashishmundrajll closed 6 years ago

ashishmundrajll commented 6 years ago

Hi All,

We have a slick carousel where there are 5 slides - 2 slides have class applied as .can-lightbox and 3 of them have additional class applied as .can-floorplan-lightbox along with .can-lightbox.

I do not want to open lightbox on click of slide, instead I have added two buttons outside of slick control in bottom of my page (Show all slides / Show floor plan slides) and on click of these buttons, I want to open lightBox showing all slides or only slides which has can-floorplan-lightbox class applied, respectively.

Any example on how to achieve this?

I tried to add following click events to both my buttons, but it does nothing -

  $('.floor-plan-icon').click(function() {
    $('#HeroCarousel').slickLightbox({
      itemSelector: '.can-floorplan-lightbox'
    });
  });

  $('.view-more-images').click(function() {
    $('#HeroCarousel').slickLightbox({
      itemSelector: '.can-lightbox'
    });
  });      

Thanks and regards, Ashish

mreq commented 6 years ago

Hey, Stack Overflow is the place to ask such questions. Please use the issues tracker for issues only.