Skip to content

Commit

Permalink
fix(zoom): use only one element to zoom
Browse files Browse the repository at this point in the history
fixes #5170
  • Loading branch information
nolimits4web committed Nov 11, 2021
1 parent 589a5d8 commit 60a9886
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/modules/zoom/zoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
gesture.$imageEl = gesture.$slideEl
.find(`.${params.containerClass}`)
.eq(0)
.find('img, svg, canvas, picture, .swiper-zoom-target');
.find('picture, img, svg, canvas, .swiper-zoom-target')
.eq(0);
gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`);
gesture.maxRatio = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
if (gesture.$imageWrapEl.length === 0) {
Expand Down Expand Up @@ -347,7 +348,8 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
gesture.$imageEl = gesture.$slideEl
.find(`.${params.containerClass}`)
.eq(0)
.find('img, svg, canvas, picture, .swiper-zoom-target');
.find('picture, img, svg, canvas, .swiper-zoom-target')
.eq(0);
gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`);
}
if (
Expand Down Expand Up @@ -449,7 +451,8 @@ export default function Zoom({ swiper, extendParams, on, emit }) {
gesture.$imageEl = gesture.$slideEl
.find(`.${params.containerClass}`)
.eq(0)
.find('img, svg, canvas, picture, .swiper-zoom-target');
.find('picture, img, svg, canvas, .swiper-zoom-target')
.eq(0);
gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`);
}
if (
Expand Down

0 comments on commit 60a9886

Please sign in to comment.