Bootstrap 5 carousel will not autoplay if added to the DOM after page load.
Prerequisites
- [X] I have searched for duplicate or closed issues
- [X] I have validated any HTML to avoid common problems
- [X] I have read the contributing guidelines
Describe the issue
Using ajax, we add the carousel html to the page, after the page has been loaded. The carousel does not autoplay.
Reduced test cases
Add to the bootstrap documentation page the steps to have the carousel autoplay when the html is inserted after pageload.
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
v5.1
Thanks for suggesting this enhancement, @Kembreg1405. While I see the value in it, it seems to address a rather specific use case. Personally, I'm hesitant to include this information as it might risk overcomplicating the documentation. Plus, I haven't checked, but it might also be true for other components or attributes/properties. I'd love to hear feedback from the community or core team members on this.
Bonjour Julien.
The info on the page is vertical and grouped in sections, each with a header.
People can skip the parts that are not relevant.
I spent literally 2 days getting this to work. An example would have helped me with this.
A text-only carousel is probably more relevant than "Individual .carousel-item interval" which is already one of the examples on the page.
Suggest adding 2 new examples.
Text only
With html insertion after page load
I spent literally 2 days getting this to work. An example would have helped me with this.
@Kembreg1405 Could you maybe share this example here for people finding this issue but then not finding the answer?