Skip to content

Commit 2649412

Browse files
committed
Add aria-labelledby for slides with captions
1 parent 2b0a483 commit 2649412

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

dist/js/parvus.esm.js

+2
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ function Parvus(userOptions) {
629629
}
630630

631631
if (captionData !== null) {
632+
GROUPS[activeGroup].sliderElements[index].setAttribute('aria-labelledby', `parvus__caption-${index}`);
633+
CAPTION_CONTAINER.id = `parvus__caption-${index}`;
632634
CAPTION_CONTAINER.innerHTML = `<p>${captionData}</p>`;
633635
container.appendChild(CAPTION_CONTAINER);
634636
}

dist/js/parvus.esm.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/parvus.js

+2
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,8 @@
635635
}
636636

637637
if (captionData !== null) {
638+
GROUPS[activeGroup].sliderElements[index].setAttribute('aria-labelledby', `parvus__caption-${index}`);
639+
CAPTION_CONTAINER.id = `parvus__caption-${index}`;
638640
CAPTION_CONTAINER.innerHTML = `<p>${captionData}</p>`;
639641
container.appendChild(CAPTION_CONTAINER);
640642
}

dist/js/parvus.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js/parvus.js

+3
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,9 @@ export default function Parvus (userOptions) {
699699
}
700700

701701
if (captionData !== null) {
702+
GROUPS[activeGroup].sliderElements[index].setAttribute('aria-labelledby', `parvus__caption-${index}`)
703+
CAPTION_CONTAINER.id = `parvus__caption-${index}`
704+
702705
CAPTION_CONTAINER.innerHTML = `<p>${captionData}</p>`
703706

704707
container.appendChild(CAPTION_CONTAINER)

0 commit comments

Comments
 (0)