Skip to content

Commit 0f37048

Browse files
committed
fix: Update anchor position
Resolves #257
1 parent 1187c38 commit 0f37048

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/js/02-on-this-page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
function onScroll () {
7171
var scrolledBy = window.pageYOffset
72-
var buffer = getNumericStyleVal(document.documentElement, 'fontSize') * 1.15
72+
var buffer = getNumericStyleVal(document.documentElement, 'fontSize') * 1.15 + 80
7373
var ceil = article.offsetTop
7474
if (scrolledBy && window.innerHeight + scrolledBy + 2 >= document.documentElement.scrollHeight) {
7575
lastActiveFragment = Array.isArray(lastActiveFragment) ? lastActiveFragment : Array(lastActiveFragment || 0)

src/js/03-fragment-jumper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
window.location.hash = '#' + this.id
1919
e.preventDefault()
2020
}
21-
window.scrollTo(0, computePosition(this, 0) - toolbar.getBoundingClientRect().bottom - 10)
21+
window.scrollTo(0, computePosition(this, 0) - toolbar.getBoundingClientRect().bottom - 80)
2222
}
2323

2424
window.addEventListener('load', function jumpOnLoad (e) {

0 commit comments

Comments
 (0)