Add option to enable/disable animation of Collapse on a per-show/hide basis
Created by: wnr
See #15747 (closed) for the original feature request.
What we want: An additional JavaScript option of $(e).collapse()
that let us disable the animation.
My proposal is that such option would be named animate
, and has a default value of true
.
Example usage:
// Collapses the element without any animation.
$(element).collapse({
toggle: true,
animate: false
});
// Collapses the element with animation, as animate is true per default.
$(element).collapse({
toggle: true
});
There are probably other Bootstrap APIs that could also benefit by having such option.
If this sounds good, I could look into creating a PR.