jackmoore / zoom

jQuery plugin for zooming images on mouseover.
http://www.jacklmoore.com/zoom/
MIT License
1.54k stars 460 forks source link

Adding an empty alt attribute for accessibility validation #121

Closed adevendorf closed 7 years ago

adevendorf commented 7 years ago

Accessibility validation tools will report an error because the zoomed image created does not contain a required alt attribute. I've set it to an empty string.

jackmoore commented 7 years ago

Looks good to me, thanks!

odahcam commented 7 years ago

Just use a role="presentation" attribute. Presentation images has no need of an alt attribute.

A blank alt is not good for acessibility, is just more junk code.

<img src="[src]" role="presentation"><!-- valid code -->
jackmoore commented 7 years ago

@odahcam Sounds good, thanks

huguestennier commented 6 years ago

Actually, an empty alt text is the recommend way for ATs to ignore them. Having no alt is also not valid HTML.