I'm trying to fade out an element with _anime.js_.
The code works but the duration does not correspond with the duration param I'm giving.
For example when I set duration to five seconds, it takes about half of that.
https://codepen.io/anon/pen/rYLRQq
anime({
targets: '.el',
opacity: 0,
duration: 5000
});
Also there's a noticable difference in duration between firefox and chrome.
Is there a way to have it more accurate?
The duration is correct. I think the issue you're seeing is that the default easing for anime is set to easeOutExpo. If you set it to linear it should be more "accurate".
Duration is accurate, but visually wrong since you're using the default easing timing function, which is 'easeOutElastic', as @alexchantastic says, use 'linear' instead.
Most helpful comment
The duration is correct. I think the issue you're seeing is that the default
easingfor anime is set toeaseOutExpo. If you set it tolinearit should be more "accurate".