Skip to main content
11 events
when toggle format what by license comment
Aug 9, 2023 at 11:09 history edited Илья Зелень CC BY-SA 4.0
deleted 1 character in body
Sep 23, 2021 at 10:05 comment added Mikko Rantalainen Note that if you use web fonts with font-display: swap you may end up with slightly incorrect scroll offset if you measure the scroll position before the fonts are swapped in. And when you use font-display: swap the swapping is asyncronous and depends on client network speed, DNS servers, web font hosting CDN and client CPU power so it's practically random. The best you can do is to try to detect the event for font loading: stackoverflow.com/a/66739727/334451
Jul 28, 2021 at 21:34 history edited Peter Mortensen CC BY-SA 4.0
Active reading [<https://en.wikipedia.org/wiki/CodePen>]. Expanded.
Sep 14, 2020 at 8:04 comment added goat Note that scrollIntoView suffers from the same problem scrollto(some px location) does - if the location of the element changes as you scroll, you will scroll to the wrong position. This can easily happen if you, for example, have unknown-dimension images loading while you're scrolling, which will push the scroll target element down, and your nice fancy scroll will stop short in an over-dramatized epic fail.
Jun 6, 2020 at 11:32 comment added gaborous This solution works very very well! Thanks for sharing!
Jun 6, 2020 at 9:41 history edited gaborous CC BY-SA 4.0
correct typos according to CodePen code (prevents overriding defaults)
Dec 23, 2019 at 8:34 history edited Илья Зелень CC BY-SA 4.0
edited body
Oct 4, 2019 at 11:13 history edited Илья Зелень CC BY-SA 4.0
added 21 characters in body
Sep 25, 2019 at 17:41 history edited Илья Зелень CC BY-SA 4.0
added 5 characters in body
Sep 2, 2018 at 16:13 history edited Илья Зелень CC BY-SA 4.0
added 584 characters in body
Sep 2, 2018 at 15:40 history answered Илья Зелень CC BY-SA 4.0