francoischalifour / medium-zoom

🔎🖼 A JavaScript library for zooming images like Medium
https://medium-zoom.francoischalifour.com
MIT License
3.59k stars 164 forks source link

Srcset zoom #51

Closed gfellerph closed 5 years ago

gfellerph commented 6 years ago

This PR tries to fix the srcset zoom problem as discussed in #27. It behaves like loading a hd image with data-zoom-target and starts the zoom after the appropriate image is being loaded. I used the load event instead of polling with an interval because in a quick local test with throttled network the load event and the interval fired at similar times with a different winner every time. Also, the load event fires nicely when the image is already cached.

There are a ton of possibilities for configuring srcset and sizes so I did not spend the time to test every single one of them, allthough I think the two cases in the demo html are pretty common ones.

Closes #27.

francoischalifour commented 6 years ago

Thank you for the new changes @tuelsch! We need to revert the changes in the README and we're ready to merge!

francoischalifour commented 5 years ago

:tada: Medium Zoom 1.0.0 has been released @tuelsch!

Check the release →