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.
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 theload
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, theload
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.