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 alt tag to images #24

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

Conversation

christiespeich
Copy link

I added in ALT tags on all of the images for accessibility.

For the links that use background-img I used the title attribute as per this suggestion: http://stackoverflow.com/questions/4216035/css-background-image-alt-attribute

This is my first time contributing to another repo so I hope I am doing it correctly. :-) Thank you for this awesome plugin.

Copy link

@ANDRBR ANDRBR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change the name of the "alt" variable declared in line 23 and add a line when you set the default image so that the alt of the image is the correct one on the first creation. Like this:

'alt' turns into 'firstAlt'

the if statement end up like this:

if((index === 0 && !defaultImage) || $(this).hasClass('sp-default')){
classes = ' class="sp-current"';
firstLarge = large;
firstThumb = $('img', this)[0].src;
firstAlt = alt;
}

Other than that, seems pretty good to me.

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