修复卡顿问题,返回顶部卡顿
This commit is contained in:
1 parent
40a86bcc76
commit
fadefdc0a1
1 file changed
+2
-1
@@ -205,7 +205,8 @@ window.initFloatingTools = function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var comments = document.getElementById('Comments') || document.querySelector('.artalk');
|
var comments = document.getElementById('Comments') || document.querySelector('.artalk');
|
||||||
if (comments) {
|
if (comments) {
|
||||||
comments.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
var y = comments.getBoundingClientRect().top + window.scrollY - 20;
|
||||||
|
window.scrollTo({ top: y, behavior: 'smooth' });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user