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

Plax on elements loaded via ajax #38

Closed
hjujah opened this issue Jan 30, 2013 · 3 comments
Closed

Plax on elements loaded via ajax #38

hjujah opened this issue Jan 30, 2013 · 3 comments

Comments

@hjujah
Copy link

hjujah commented Jan 30, 2013

Hi,
I can't make plax to work on elements loaded via ajax.

On document ready I have this code:
$('.plax').plaxify();
$.plax.enable({ "activityTarget": $('footer')});

Then before my ajax call i have this:
$.plax.disable(true);

And when the content is loaded i call again:
$.plax.enable({ "activityTarget": $('footer')});

Note:Ajax function completely destroys old plax elements and render new ones.
Please can you advise? What am I doing wrong?
Thanks in advance.for your answer!

@cameronmcefee
Copy link
Owner

Hi @hjujah,

Since you're removing the plaxed elements from the DOM entirely, they're removed from Plax too. My guess is you'll want to do $('.plax').plaxify(); again (or on whatever your new content is) to be sure you add the new content before you call $.plax.enable again.

@hjujah
Copy link
Author

hjujah commented Jan 30, 2013

Thanks a lot for the tip! Great plugin, btw... I love it

@cameronmcefee
Copy link
Owner

Thanks! I'm glad you find it useful.

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

No branches or pull requests

2 participants