我在方法中使用滚动
const scrollToCenter = () => {
const kon = document.querySelector('.clazz');
const width = kon.offsetWidth;
kon.scrollTo(width / 2, 0);
};
Run Code Online (Sandbox Code Playgroud)
而且在Chrome和Mozilla中都可以正常运行。在Edge中,我收到一个错误“对象不支持属性或方法scrollTo”。在Edge中有使用它的其他方法吗?