Closed fennifith closed 1 year ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit a490d0b50ff16e26a54f845824108edcc741c3be:
Sandbox | Source |
---|---|
@medium-zoom/vanilla-example | Configuration |
Closes #174.
🎉 This was released in v1.0.8.
Awesome - thank you! \:D
Summary
Issue #174 details a lack of support for differences in the selected image within a
<picture>
tag. In this case, the image'scurrentSrc
reflects which of the available sources the browser decided to use.In my case, the
<img>
tags lack any src whatsoever, so when used outside of the<picture>
tags they will not display any image.Result
I took a slightly more naive solution than what is described in #174 - any
<img>
tag in a<picture>
structure now setszoomed.src = original.currentSrc
after cloning the element. This ensures that the zoomed image will reflect the same source as what was originally displayed in the<picture>
tag, and eliminates any flicker in the transition when used withdata-zoom-src
.