Bootstrap 4 uses the class .collapsing
to animate the width / height of the .collapse element when it opens / closes. Unfortunately, the real changes are added by adding a width / height as an inline style to the element and adding and removing a class at the beginning and end of the transition. Therefore, itβs quite difficult to set up a transition (for example, change the time or fade in / out instead of a width transition).
What I have tried so far:
- Adding the css property
transition:none
to the class .collapsing
: this helps to get rid of the transition, but opening / closing is still delayed by the transition time, since the class is still added a few milliseconds before the actual change occurs. - Adding custom CSS keyframes to the class
.collapsing
: since the same class is used to open and close, the same animation is displayed for both.
Is there a way to change the transition, for example. fade in / out (change opacity) or do I need to create a custom version of bootstrap.js?
source
share