I tried to add a function to change the current zoomed image (https://github.com/francoischalifour/medium-zoom/issues/60).
A lot of the code is duplicated from the open / close functions, and a lot of improvement could be made.
I didn't write the test, but I added a storybook file. I hope that this work can be improved by somebody else...
Result
Call the change({target}) function to display another image on the opened zoom.
It can be used to add next / previous buttons on a custom template.
Summary
I tried to add a function to change the current zoomed image (https://github.com/francoischalifour/medium-zoom/issues/60). A lot of the code is duplicated from the open / close functions, and a lot of improvement could be made. I didn't write the test, but I added a storybook file. I hope that this work can be improved by somebody else...
Result
Call the
change({target})
function to display another image on the opened zoom. It can be used to add next / previous buttons on a custom template.