I have a bootstrap collapse panel which is loaded with a lot of data from an ajax call. When the data is loaded in the collapse panel is populated with ~ 2000 dom elements, mainly checkboxes and spans. I've measured the time for the call and the creation of the dom elements, and it doesn't seem to be a problem. It takes less than a second to load and create the elements using jQuery.
However, when I click to expand collpased panel it causes the site to lag, and it takes a good while for the panel to expand.
Is there any solution to this, or an alternative to the bootstrap collapse panels? Could you expand it and show the elements incrementally as you scroll?
I don't seem to have any problem at all with collapse panels that contain less elements.
<div id="collapse_function" class="panel-collapse collapse">
<div class="panel-body">
<div class="panel-group" id="inner_accordion">
<!-- Checkboxes and spans are loaded here dynamically -->
</div>
</div>
Edit: It seems to be the case that even with disabled animations, the site lags.