simplelightbox
simplelightbox copied to clipboard
Set class on an image based on one clicked?
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!