jquery.videoBG icon indicating copy to clipboard operation
jquery.videoBG copied to clipboard

Clone container contents instead of container itself

Open sblomberg opened this issue 11 years ago • 1 comments

When the line wrap.html(container.html()); was changed to wrap.html(container.clone(true)); it fixed the problem of JS events getting lost, but now instead of copying the container content, it makes a duplicate of the container itself. This duplication leads to problems with the default videoBG usage, as it creates another <body> element within the main <body> element, which in turn causes incompatibilities with other plugins and code that perform operations on $(“body”).

This commit still uses the jQuery clone() method to maintain JS events, but instead of cloning the container, it clones the container’s children (i.e. its content) into the videoBG wrapper.

sblomberg avatar Dec 10 '13 17:12 sblomberg

I believe this one should be merged, any thoughts @sydlawrence ?

robink avatar Aug 26 '14 10:08 robink