simplelightbox icon indicating copy to clipboard operation
simplelightbox copied to clipboard

Set class on an image based on one clicked?

Open jacklawry opened this issue 4 years ago • 0 comments

I am looking to set a class on the lightbox image based on the link clicked... I want to have specific styles based on the layout of an image so landscape, portrait or square.

I want to apply a class to the dynamic lightbox sl-wrapper based on the aspect of the image clicked (this is currently both a class and also a data-aspect=“@aspect” that is applied to the tag) I have tried to use the className property but this doesn’t seem to work based on a var set on click of the image (although it will alert/console.log the correct value)…

I then also want this to update based on the image shown.

Any help appreciated!

jacklawry avatar Jul 07 '20 12:07 jacklawry