lokesh / lightbox2

THE original Lightbox script (v2).
http://lokeshdhakar.com/projects/lightbox2/
MIT License
6.19k stars 1.76k forks source link

Adding alt attribute for lb-image #579

Closed ChrisEbner closed 6 years ago

ChrisEbner commented 7 years ago

the alt attribute is required by html spec and also necessary for screen-reader users to perceive the contents of images. This adds the image title as alt attribute to lb-image.

This should fix #571, #364

ondrejsevcik commented 6 years ago

@lokesh any chance that this will make it into the release?

lokesh commented 6 years ago

Sorry for delays. The problem as stated is correct, there is no simple way to add an alt attribute to the displayed image.

I've instituted a fix which adds a new data-alt attribute on the link. This approach is preferable to populating the alt attr with the title as those two items are distinct.

The addition of the data-alt option is queued up in the dev branch and should be released soon. https://github.com/lokesh/lightbox2/pull/609

Thanks.