kenwheeler / slick

the last carousel you'll ever need
kenwheeler.github.io/slick
MIT License
28.49k stars 5.89k forks source link

auto scroll tabs with slick #3595

Open huzanf opened 5 years ago

huzanf commented 5 years ago

Hi, I have 5 tabs: Tab A | Tab B | Tab C | Tab D | Tab E.

Under each tab I have roughly around 3-7 images. The number varies for each tab. The images under each tab have a slick slider which works fine. I would like to switch the tab once the number of images in each tab are over. How can I achieve this?

Kindly support. Thank You in advance.

0liver commented 5 years ago

try something like this:

$("#my-gallery).slick().on('afterChange', function(ev, instance, current) {
    // instance is the **slick** instance
    // current is the **index** of the current slide
    if (instance.slideCount == current) {
        // put custom code to switch tabs here
    }
}