Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
fixed alt attr adding
Browse files Browse the repository at this point in the history
  • Loading branch information
akaunderr committed Dec 28, 2023
1 parent 8042c60 commit ead8a97
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions jquery.nivo.slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,22 @@

// Set current background before change
if (!nudge) {
sliderImg.attr('src', src(vars.currentImage));
sliderImg.prop({
src: src(vars.currentImage),
alt: vars.currentImage.attr('alt')
});
} else {
if (nudge === 'prev') {
sliderImg.attr('src', src(vars.currentImage));
sliderImg.prop({
src: src(vars.currentImage),
alt: vars.currentImage.attr('alt')
});
}
if (nudge === 'next') {
sliderImg.attr('src', src(vars.currentImage));
sliderImg.prop({
src: src(vars.currentImage),
alt: vars.currentImage.attr('alt')
});
}
}

Expand Down

0 comments on commit ead8a97

Please sign in to comment.