akiran / akiran/react-slick

React Slick add & remove class to active li through iteration

Đang mở
#2,044 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
11.9k
Fork
2.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

My settings:
const settings = {
dots: true,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
autoplay: false,
useCSS: 1,
autoplaySpeed: 1000,
appendDots: dots => (

    {dots}

),
};

![image](https://user-images.githubusercontent.com/49042523/122037279-0e433f80-cdf2-11eb-9b7e-42cdac3b8e42.png)

I have been trying for days to do this. It works with Vanilla javascript but not in Nextjs. I want the active li to have slick-active class + Active-class-n

I'm new to Nextjs and React. Is there a way to add class(Active-class-n) to li after clicking on dots(1,2,3,4) and remove Active-class-n if clicked on previous button and remove all classes when clicked on the first button..

Javascript Demo: (Inspect the li for result)
https://jsfiddle.net/opagqs1m/1/

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.