我在 angular.js 中使用了这个,但我不知道如何将它转换为 Angular 8。我需要在 DOM 中找到第一个“iframe”并在触发此 scrollToTop 的按钮单击上滚动到它的顶部() 函数。
scrollToTop() {
//need to scroll on body and html elements due to browser differences
let editorBody = this.$document.find('iframe')[0].contentDocument.body;
let editorHtml = this.$document.find('iframe')[0].contentDocument.documentElement;
angular.element(editorBody).duScrollTop(0);
angular.element(editorHtml).duScrollTop(0);
}
慕码人2483693
相关分类