Skip to content

Commit 6956c06

Browse files
authored
Merge pull request #138 from pierrekamel5/master
added alt for image features
2 parents bc654e9 + ef22ee2 commit 6956c06

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

widget/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139

140140
function _initImg(item) {
141141
var src = item.getAttribute('data-src');
142-
142+
var imageTextAlternative = item.getAttribute('data-alt')
143143
var options = {};
144144
options.size = item.getAttribute('data-crop-size');
145145
options.aspect = item.getAttribute('data-crop-aspect');
@@ -150,7 +150,8 @@
150150
// enable for cache
151151
// buildfire.imageLib.cropImage(src, options, img);
152152
img.src = buildfire.imageLib.cropImage(src, options);
153-
153+
img.alt = imageTextAlternative;
154+
img.title = imageTextAlternative;
154155
img.className = 'reveal-img';
155156

156157
if (img.complete) _addImg();
@@ -292,6 +293,7 @@
292293
divImg.setAttribute("data-crop-aspect", options.aspect);
293294
divImg.setAttribute("data-crop-width", options.width);
294295
divImg.setAttribute("data-crop-height", options.height);
296+
divImg.setAttribute("data-alt", p.title);
295297
divImg.classList.add('lazy-img');
296298
}
297299
else {
@@ -811,7 +813,6 @@
811813
width: window.innerWidth,
812814
height: Math.ceil(9 * (window.innerWidth) / 16)
813815
}));
814-
img.alt = "Carousel Image";
815816
carouselContainer.appendChild(img);
816817
img.addEventListener("click", function () {
817818
buildfire.actionItems.execute(carouselImages[0], function (err, result) {
@@ -882,7 +883,6 @@
882883
infinite:false,
883884
autoInterval:speed
884885
});
885-
886886
} else {
887887
appendOneImage(carouselImages);
888888
}

0 commit comments

Comments
 (0)