I tried this way but did not succeed. My intention is to make as an effect of the Bézier curve.
var count = 0;
var times = 100;
var fn = function() {
count++;
if(count === 25) {
console.log(count, times);
times = 1000;
}
if(count === 50) {
console.log(count, times);
clearInterval(interval);
}
document.getElementById('div').style.left = count + 'px';
}
var interval = setInterval(fn, times);
#div {
background-color: black;
height: 100px;
width: 100px;
position: relative;
left: 0px;
}
<div id="div"></div>