Codeinwp / Nivo-Lightbox-jQuery

A simple, flexible, responsive, retina-ready jQuery lightbox plugin.
http://dev7studios.com/nivo-lightbox
MIT License
157 stars 87 forks source link

Doesn't close on click (Here is the fix) #55

Open amiga-500 opened 8 years ago

amiga-500 commented 8 years ago

Noticed in your code across all browsers that there is an inconsistency when u attempt to close the popup image (when u click outside the image area). The problem is in your js script...you forgot to include something like this in the area when it destroys the popup:

if (t.target === this || e(t.target).hasClass("nivo-lightbox-content") || e(t.target).hasClass("nivo-lightbox-image") || e(t.target).hasClass("nivo-lightbox-wrap")) { a.destructLightbox()

Notice the end part of the if statement has e(t.target).hasClass("nivo-lightbox-wrap") When i used firebug to inspect i notice randomly all the major browsers seem to get confused and makes the wrap higher in the z order and so clicking cant happen..you have to click further away. When you include e(t.target).hasClass("nivo-lightbox-wrap") it now works consistently.