请检查这个codepen,那里描述了问题。还有一个演示。
https://codepen.io/NeXTs/pen/abBwXVw
// snippet of code required by stackoverflow to post a question
slider.addEventListener("scroll", _.debounce((e) => {
const currentHeight = parseFloat(e.target.style["height"]);
e.target.style["height"] = currentHeight + (flag ? 5 : -5) + "px";
flag = !flag;
}, 50));
我已经在 Mac 和 Windows 上测试过了。
Chrome 中的相同行为(在 mac 和 windows 上)
同时其他浏览器(甚至是 webkit 上的 Safari 和 Opera)不会立即跳转到最近的快照点。
这是一个错误?
如果是这样,我可以报告它的正确位置是什么?或者我可以询问的正确位置(与 webkit 相关)是什么?