2
我使用Javascript方法Element.scrollIntoView()
https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView如何知道滚动到元素是在Javascript中完成的?
有什么办法可以知道,当滚动结束。说有一个动画,或者我已经设置了{behavior: smooth}
。
我假设滚动是异步,并想知道是否有任何回调像机制。
IntersectionObserver Safari中并没有:( –
支持@SushantGupta _ “IntersectionObserver Safari中并没有支持” _ Safari浏览器不支持'.scrollIntoView()',根据链接到MDN的问题。 – guest271314
'scrollIntoView'正在Safari中为我工作,只不过'{behavior:'smooth'}'不支持移植。 http://caniuse.com/#search=scrollintoview –