大家好吗?
我正在尝试在单击上滚动,但是目标div在“平滑”滚动栏中。
用于平滑滚动条的库为https://github.com/idiotWu/smooth-scrollbar
我尝试了与此相关的所有参数,但没有得到任何解决方案。
任何人都可以帮我。
提前感谢
在scrollIntoView()
实例中使用scrollIntoView()
Scrollbar
let instance = Scrollbar.init(document.getElementById("scroll"));
document.querySelector("button").addEventListener('click', function(event) {
instance.scrollIntoView(document.getElementById("intoview"))
})
#scroll {
height: 85vh;
overflow: auto;
}
#intoview {
font-weight: bold;
}