2

How fast is the Bootstrap 4 collapse animation? I am unable to find it in the messy bootstrap.js file. My goal is to scroll down to the bottom of unpacked div with the same speed as the default Bootstrap collapsing. I use a code from here.

$("html, body").animate({scrollTop: $("#myID").scrollTop()}, 1000);

I want to find a precise value instead of 1000 which is too small causing the scrolling is slow.

Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183

1 Answers1

2

According to the jQuery documentation on animate():

Durations are given in milliseconds; higher values indicate slower animations, not faster ones. The default duration is 400 milliseconds. The strings 'fast' and 'slow' can be supplied to indicate durations of 200 and 600 milliseconds, respectively.

The value you are looking for should be 400.

Obsidian Age
  • 41,205
  • 10
  • 48
  • 71
  • A piece of cake for you! It matches the Bootstrap collapsing well. So Bootstap uses the default animation speed? Is it this fact documented anywhere on the Bootstrap side? – Nikolas Charalambidis Aug 26 '18 at 22:40