I would like to let a user or an admin for my site select whether Bootstrap 4 collapse elements should be animated. The reason is that the animation gets unsmooth if many elements are moved by the animation, so it is better to turn it off when users work with large amounts of elements on a page.
The (static) CSS to turn it off is (from this answer)
.collapsing {
-webkit-transition: none;
transition: none;
display: none;
}
However, how can I enable/disable this css at runtime?
Note that the collapsing
class is set by Bootstrap automatically; AFAIK I have no control over which elements have this class and which don't.