igorlino / elevatezoom-plus

Enhanced elevateZoom - A jQuery image zoom plugin
http://igorlino.github.io/elevatezoom-plus/
MIT License
162 stars 77 forks source link

Hidden images cause zoomContainer to show in upper left corner #94

Closed cgmonroe closed 6 years ago

cgmonroe commented 6 years ago

I have a page with several 'accordion' tabs on it. Each tab has a screenshot that has an ez-plus lens associated with it.

The tab images work fine when they are opened. However, if I move my mouse to the upper left corner, I get a lens showing the last tab's image.

It appears that the zoomContainer can't be located when the image associated with it is hidden. So the empty zoomContainers get stacked up in the upper left corner of the body tag. When a tab is opened and the mouse moves over the image, the zoomContainer is relocated on top of the image and things work for that image. Closing the tab and rolling over another image, relocates the hidden div to the top.

Attached is a patch that will hide / show the zoomContainers only when the mouse is over an image. This prevents to phantom magnifier in the corner.

Note: This patch is only for lens mode, I suspect that the same thing may happen with inner and window modes with hidden images. But I didn't have time to set up and test these modes. :)

elevatezoom-plus_support-hidden-img-with-lens.zip

igorlino commented 6 years ago

Thanks @cgmonroe , I have applied the patch you gave.