Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set class on an image based on one clicked? #184

Open
jacklawry opened this issue Jul 7, 2020 · 0 comments
Open

Set class on an image based on one clicked? #184

jacklawry opened this issue Jul 7, 2020 · 0 comments

Comments

@jacklawry
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants