Skip to content

Commit 81db5d6

Browse files
committed
fix(website): scroll mockup content instead of page on outline click
1 parent f7aad09 commit 81db5d6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

website/js/site.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
item.addEventListener('click', function () {
7474
const target = document.getElementById(item.dataset.target)
7575
if (!target) return
76-
target.scrollIntoView({ behavior: 'smooth', block: 'start' })
76+
mockupContent.scrollTo({ top: target.offsetTop - mockupContent.offsetTop, behavior: 'smooth' })
7777
outlineItems.forEach(function (el) { el.classList.remove('active') })
7878
item.classList.add('active')
7979
})

0 commit comments

Comments
 (0)