Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

onClick stops working once an images loop #66

Open
erikksuzuki opened this issue Aug 28, 2023 · 0 comments
Open

onClick stops working once an images loop #66

erikksuzuki opened this issue Aug 28, 2023 · 0 comments

Comments

@erikksuzuki
Copy link

erikksuzuki commented Aug 28, 2023

      <TinySlider onClick={showSlideInfo} settings={settings}>
        {sideImages.map((image: any, index: number) => {
          return (
            <div className="relative w-[140px]" key={`sideimage-${index}`}>
              <img
                id={`slideid-${image.index}`}
                src={image.src}
                className="cursor-pointer w-full opacity-50 hover:opacity-100 transition-all"
                style={{
                  transitionProperty: 'all',
                  transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)',
                  transitionDuration: '400ms',
                }}
                onClick={() => openLightbox(image.src)}
              />
            </div>
          )
        })}
      </TinySlider>
    </div>```

openLightbox() works the first time the slider goes through the images, but after the loop it the onClick property seems to disappear entirely.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant