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

Inline content not removed #20

Open gilbitron opened 10 years ago

gilbitron commented 10 years ago

My problem occured when trying to "popin" inline content via nivo-lightbox. My initial content's behaviour was really strange when being displayed via nivo-lightbox and not without.

Then some investigations showed me that you clone initial content into a nivo wrapper without removing initial content. Thus if initial content may be accessed via other parts of code (for example via html ids), things are getting bad.

Thus replacing this line of code within the inline section:

wrap.append($(href).clone().show()); 

with these two others

wrap.append($(href).clone(true).show()); 
$(href).empty(); 

everything then plays well.

adanarchila commented 10 years ago

Not so much, if you close the modal and try to open it again is empty.