Photoswipe: Photoswipe image alt text

Created on 11 Feb 2015  路  4Comments  路  Source: dimsemenov/PhotoSwipe

I see the ability to add a caption by adding it when building the array:

var openGallery1 = function() {
var pswpElement = document.querySelectorAll('.pswp')[0];

// build items array
var items = [
    {
        src: 'img/photos/photo1.jpg',
    title: 'Title for Photo 1',
        w: 800,
        h: 555
    }, 
etc, etc

Is there a way to also add alt text? I would like to have it for improved SEO since the site won't have much text on it.

Most helpful comment

Alt text isn't just for SEO - it's also important for users who are blind or low-vision and navigate using the screenreader. If I wanted to add this in, where would I start?

All 4 comments

You won't get any SEO benefit from alt tag in dynamically generated image after a few seconds from page load.

Follow this guide - http://photoswipe.com/documentation/seo.html

Alt text isn't just for SEO - it's also important for users who are blind or low-vision and navigate using the screenreader. If I wanted to add this in, where would I start?

As discussed above, alt text support is not only desirable for SEO reasons. Accessibility is also a concern. I have come across a scenario in which the lack of alt text was being counted against a website in an accessibility scan. I have submitted a pull request that allows for alt text to be added in the same way a title is added: https://github.com/dimsemenov/PhotoSwipe/pull/1703

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jamminjames picture jamminjames  路  3Comments

JoffreyT picture JoffreyT  路  5Comments

rnnyrk picture rnnyrk  路  5Comments

skyghis picture skyghis  路  5Comments

ergec picture ergec  路  3Comments