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

Add description as alt text in viewer mode #352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonkeane
Copy link

@jonkeane jonkeane commented Jul 5, 2021

This adds the content from the description of the image to the alt tag when in viewer mode.

@ajmeese7
Copy link

I agree with this idea so the image has alt text by default, but I think this could be extended further to allow the user to specify alt text as a specific option if they so choose.

@jonkeane
Copy link
Author

I agree with this idea so the image has alt text by default, but I think this could be extended further to allow the user to specify alt text as a specific option if they so choose.

I'm happy to try and add this as an option — but want to make sure I get what you're going for: Do you mean add an option like descriptionAsAlt: true to

jQuery.nanogallery2.defaultOptions = {
and then surface that for configuration too? If it's true, do what's in this patch already, if false, then do nothing for alt text?

@ajmeese7
Copy link

ajmeese7 commented Jun 4, 2023

@jonkeane I was thinking just have like an altText option that defaults to the description if not otherwise specified, something like the following modification to your code:

var alt_text = this.altText || this.description;

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

Successfully merging this pull request may close these issues.

2 participants