Is there a way to allow users or admins on my website to decide whether or not Bootstrap 4 collapse elements should be animated? The concern is that when many elements are moved by the animation, it becomes less smooth. Therefore, it would be ideal to give users the option to turn off the animation, especially when working with numerous elements on a page.
The CSS code to disable the animation (as per this answer) is:
.collapsing {
-webkit-transition: none;
transition: none;
display: none;
}
But how can I toggle this CSS on or off at runtime?
Keep in mind that the collapsing
class is automatically assigned by Bootstrap; I have no say over which elements have this class and which do not.