可以试试参考函数防抖和节流函数。
尝试一下在setInterval里打印一下outerWidth*initIndex是怎么变化的
倒数第五行是:'transition':`transform ${transitionTime}s ease`,