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

Can't initialize a component after it was loaded with AJAX later #12494

Open
kaszarobert opened this issue Oct 27, 2022 · 0 comments
Open

Can't initialize a component after it was loaded with AJAX later #12494

kaszarobert opened this issue Oct 27, 2022 · 0 comments

Comments

@kaszarobert
Copy link

Description

We encountered an issue that if we load HTML content dynamically with AJAX calls, the loaded Tab, Accordion etc. components don't work. I found information about that only for Foundation 5 https://get.foundation/sites/docs-v5/components/accordion.html#adding-new-accordion-content-after-page-load but not for Foundation 6. There is something like that mentioned https://get.foundation/sites/docs/accordion.html#js-class but it's really not clear what types of variables does it need, and I couldn't get it working that way. If the component is available in the document at page load, everything works.

I also tried $(document).foundation(); and $(".accordion").foundation('accordion'); but still don't work.

Possible Solution

Checklist

  • [ x ] I have read and follow the CONTRIBUTING.md document.
  • [ x ] There are no other issues similar to this one.
  • [ x ] The issue title and template are correctly filled.
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

1 participant