Browse Source

Ignore thumbnails with `aria-hidden`

pull/243/head
Jānis Skarnelis 3 years ago
parent
commit
34babdb451
  1. 7
      src/Fancybox/Fancybox.js

7
src/Fancybox/Fancybox.js

@ -326,12 +326,15 @@ class Fancybox extends Base {
if (origTarget instanceof HTMLImageElement) {
$thumb = origTarget;
} else {
$thumb = origTarget.querySelector("img");
$thumb = origTarget.querySelector("img:not([aria-hidden])");
}
}
if (!$thumb && slide.$trigger) {
$thumb = slide.$trigger instanceof HTMLImageElement ? slide.$trigger : slide.$trigger.querySelector("img");
$thumb =
slide.$trigger instanceof HTMLImageElement
? slide.$trigger
: slide.$trigger.querySelector("img:not([aria-hidden])");
}
}

Loading…
Cancel
Save