We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
alt
<figure>
1 parent a6ee814 commit b6975efCopy full SHA for b6975ef
view-transitions/spa/script.js
@@ -37,6 +37,7 @@ function init() {
37
})
38
39
galleryImg.src = `images/${ imageData[0].file }.jpg`;
40
+ galleryImg.alt = imageData[0].name;
41
galleryCaption.textContent = imageData[0].name;
42
}
43
@@ -47,6 +48,7 @@ function updateView(event) {
47
48
const displayNewImage = () => {
49
const mainSrc = `${targetIdentifier.src.split("_th.jpg")[0]}.jpg`;
50
galleryImg.src = mainSrc;
51
+ galleryImg.alt = targetIdentifier.alt;
52
galleryCaption.textContent = targetIdentifier.alt;
53
};
54
@@ -60,4 +62,4 @@ function updateView(event) {
60
62
const transition = document.startViewTransition(() => displayNewImage());
61
63
64
-init();
65
+init();
0 commit comments