Skip to content

Commit 571252b

Browse files
committed
update comment text
1 parent 352a07c commit 571252b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/js/06-code.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,8 @@ document.addEventListener('DOMContentLoaded', function () {
291291
var shift = topOfTabPosition - newTopOfTabPosition
292292

293293
window.scrollTo({
294-
top: topOfWindowPosition - shift - offset, // center clicked tab to a fifth of viewport height
295-
behavior: 'instant',
294+
top: topOfWindowPosition - shift - offset, // scroll back to the same position before the click
295+
behavior: 'instant', // instantly so nothing is visible to the user
296296
})
297297
}
298298

src/js/08-tabs-block.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ document.addEventListener('DOMContentLoaded', function () {
7777
var shift = topOfTabPosition - newTopOfTabPosition
7878

7979
window.scrollTo({
80-
top: topOfWindowPosition - shift - offset, // center clicked tab to a fifth of viewport height
81-
behavior: 'instant',
80+
top: topOfWindowPosition - shift - offset, // scroll back to the same position before the click
81+
behavior: 'instant', // instantly so nothing is visible to the user
8282
})
8383

8484
if (sessionStorageAvailable) {

0 commit comments

Comments
 (0)