From ead8a9747b87e37577f633275135d9629cf2531e Mon Sep 17 00:00:00 2001 From: akaunderr Date: Thu, 28 Dec 2023 16:20:45 +0200 Subject: [PATCH] fixed alt attr adding --- jquery.nivo.slider.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/jquery.nivo.slider.js b/jquery.nivo.slider.js index fa82ebb..0bd80c9 100644 --- a/jquery.nivo.slider.js +++ b/jquery.nivo.slider.js @@ -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') + }); } }