Skip to content
Snippets Groups Projects
Commit 59914e28 authored by Olivia206's avatar Olivia206
Browse files

fixed a11y for lightbox modal

parent 1d06578b
No related branches found
No related tags found
No related merge requests found
import gLightbox from 'glightbox';
gLightbox({
let lightboxBtn;
const lightbox = gLightbox({
openEffect: 'fade',
closeEffect: 'fade'
closeEffect: 'fade',
onOpen: () => {
lightboxBtn = document.activeElement;
},
onClose: () => {
if (lightboxBtn) {
lightboxBtn.focus();
}
}
});
lightbox.on('slide_changed', () => {
const currentSlide = document.querySelector('.gslide.current');
if (currentSlide) {
currentSlide.setAttribute("tabindex", "0");
currentSlide.focus();
}
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment