🐛 Fixed the tool button scroll Y pixes.

This commit is contained in:
凡梦星尘 2022-10-06 13:57:37 +08:00
parent 6a42188853
commit b04c1b9aa0

View File

@ -24,23 +24,22 @@ HTMLElement.prototype.wrap = function(wrapper) {
NexT.utils = {
registerToolButtons: function() {
const comms_offset = document.getElementById('comments').getBoundingClientRect().top + window.scrollY;
document.getElementById('goto-comments').addEventListener('click', () => {
window.anime({
targets : document.scrollingElement,
duration : 500,
easing : 'linear',
scrollTop: comms_offset
scrollTop: document.getElementById('comments').getBoundingClientRect().top + window.scrollY
});
});
const gt_offset = document.getElementById('google_translate_element').getBoundingClientRect().top + window.scrollY;
document.getElementById('goto-gt').addEventListener('click', () => {
window.anime({
targets : document.scrollingElement,
duration : 500,
easing : 'linear',
scrollTop: gt_offset
scrollTop: document.getElementById('google_translate_element').getBoundingClientRect().top + window.scrollY
});
});
},