matiasgali / guillotine

jQuery plugin to crop images within an area (fully responsive), allowing to drag (touch support), zoom and rotate.
http://guillotine.js.org
326 stars 100 forks source link

swap the image? #18

Closed ytokgoz closed 9 years ago

ytokgoz commented 9 years ago

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 ?

matiasgali commented 9 years ago

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!

matiasgali commented 9 years ago

See stackoverflow.com/questions/27380545/jquery-guillotine-swap-image for further reference on the topic.