【发布时间】:2020-01-28 01:48:17
【问题描述】:
我在 Angular 7 应用程序中使用 ngb 模态, 在打开模式时,我需要在执行特定操作时滚动到模式的顶部。
比如modal底部有个按钮,点击这个按钮,需要页面滚动到modal的顶部,
我尝试使用
window.scrollTop = 0;
和
document.getElementsByClassName('custom-modal').scrollTop = 0;
和
document.getElementsByClassName('custom-modal').scrollTo({
top: 0
})
但这些解决方案不起作用。
【问题讨论】:
标签: bootstrap-4 bootstrap-modal angular7