Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone container contents instead of container itself #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sblomberg
Copy link

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.

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 actually creating another body element
within the main body element, which in turn causes incompatibilities
with other plugins and code that perform operations on the “body”
element.

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.
@robink
Copy link

robink commented Aug 26, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants