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

Added alt parameter to every img tag where provided #195

Open
wants to merge 1 commit into
base: 4.0/develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions js/supersized.3.2.7.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
vars.current_slide - 1 < 0 ? loadPrev = base.options.slides.length - 1 : loadPrev = vars.current_slide - 1; // If slide is 1, load last slide as previous
var imageLink = (base.options.slides[loadPrev].url) ? "href='" + base.options.slides[loadPrev].url + "'" : "";

var imgPrev = $('<img src="'+base.options.slides[loadPrev].image+'"/>');
var imgAlt = (base.options.slides[loadPrev].alt) ? "alt='" + base.options.slides[loadPrev].alt + "'" : "";
var imgPrev = $('<img ' + imgAlt + 'src="'+base.options.slides[loadPrev].image+'"/>');
var slidePrev = base.el+' li:eq('+loadPrev+')';
imgPrev.appendTo(slidePrev).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading prevslide');

Expand All @@ -164,7 +165,8 @@

// Set current image
imageLink = (api.getField('url')) ? "href='" + api.getField('url') + "'" : "";
var img = $('<img src="'+api.getField('image')+'"/>');
var imageAlt = (api.getField('alt')) ? "alt='" + api.getField('alt') + "' " : "";
var img = $('<img ' + imageAlt + 'src="'+api.getField('image')+'"/>');

var slideCurrent= base.el+' li:eq('+vars.current_slide+')';
img.appendTo(slideCurrent).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading activeslide');
Expand All @@ -181,7 +183,9 @@
vars.current_slide == base.options.slides.length - 1 ? loadNext = 0 : loadNext = vars.current_slide + 1; // If slide is last, load first slide as next
imageLink = (base.options.slides[loadNext].url) ? "href='" + base.options.slides[loadNext].url + "'" : "";

var imgNext = $('<img src="'+base.options.slides[loadNext].image+'"/>');
var imageAlt = (base.options.slides[loadNext].alt) ? "alt='" + (base.options.slides[loadNext].alt) + "' " : "";

var imgNext = $('<img ' + imageAlt + 'src="'+base.options.slides[loadNext].image+'"/>');
var slideNext = base.el+' li:eq('+loadNext+')';
imgNext.appendTo(slideNext).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading');

Expand Down Expand Up @@ -492,7 +496,8 @@
var linkTarget = base.options.new_window ? ' target="_blank"' : '';

imageLink = (base.options.slides[loadSlide].url) ? "href='" + base.options.slides[loadSlide].url + "'" : ""; // If link exists, build it
var img = $('<img src="'+base.options.slides[loadSlide].image+'"/>');
var imageAlt = (base.options.slides[loadSlide].alt) ? "alt='" + (base.options.slides[loadSlide].alt) + "' " : "";
var img = $('<img ' + imageAlt + 'src="'+base.options.slides[loadSlide].image+'"/>');

img.appendTo(targetList).wrap('<a ' + imageLink + linkTarget + '></a>').parent().parent().addClass('image-loading').css('visibility','hidden');

Expand Down