nanogallery2
nanogallery2 copied to clipboard
Add description as alt text in viewer mode
This adds the content from the description of the image to the alt tag when in viewer mode.
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 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 https://github.com/nanostudio-org/nanogallery2/blob/35b4e095988e460a8bc79ce549764c0b98121bb1/src/jquery.nanogallery2.core.js#L1325 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?
@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;