matiasgali/guillotine

swap the image?

ytokgoz opened this issue · 2 comments

hi there i have put some thumbnail images on the same page and when you click on the thumbnail it swaps with the big image, i call the script again but unfortunetly it does not set it and crop doesnt work.
can you provide an example with multiple images or a method to restart the script ?

Please read CONTRIBUTING.md before opening issues.

Don't use the issue tracker for questions, use one of the other means listed for such purpose.

Towards the end of the thread in #3 you'll find some explanations of how the plugin works internally and why you shouldn't swap images over the same instance of the plugin. It's better to re-initialize the plugin over the new image, you'll avoid some headaches that way.

If you are indeed creating a new instance of the plugin, you must remember to remove the existing instance first with picture.guillotine('remove'), otherwise you may face unexpected results like in #5.

Happy codding!