jackmoore / zoom

jQuery plugin for zooming images on mouseover.
http://www.jacklmoore.com/zoom/
MIT License
1.54k stars 460 forks source link

destroy event doesn't destroy the instance when the big image wasn't loaded yet #83

Closed ppowalowski closed 8 years ago

ppowalowski commented 9 years ago

When you try to trigger the zoom.destroy event, when the big image was not loaded yet, the event is triggered properly but zoom runs into a trap as it initializes itself in the the onload portion of the code.

jackmoore commented 8 years ago

I decided to fix it by cancelling the generated img's onload event, but thank you for pointing out the issue and submitting a pull request. My apologies for the late response.