$scroll target scroll offset not always an Integer
See original GitHub issueScroll offset calculation sometimes gives us a value with a fraction ex: 8245.125
target = target.getBoundingClientRect().top + window.pageYOffset
then, it fails this check:
if (Number.isInteger(target)) {
continues to:
if (typeof target !== 'object')
and throws Unsupported $scroll target error
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
offsetting an html anchor to adjust for fixed header [duplicate]
Sometimes it works, some other clicks it doesn't (scroll position stays at the anchor position). I am totally out of ideas what could...
Read more >Element.scrollTop - Web APIs | MDN
The Element.scrollTop property gets or sets the number of pixels that an element's content is scrolled vertically.
Read more >locomotivemtl/locomotive-scroll: Detection of elements in ...
Detection of elements in viewport & smooth scrolling with parallax. ... offset (integer) : Defines an offset from your target.
Read more >Smooth Scrolling | CSS-Tricks
Here's the code to perform a smooth page scroll to an anchor on the same page. It has some logic built in to...
Read more >.scrollLeft() | jQuery API Documentation
The horizontal scroll position is the same as the number of pixels that are hidden from view to the left of the scrollable...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Good catch. I think we can simply use Math.floor(…) to round down the result. Are you happy to send a PR? Otherwise I can have a look tomorrow.
Yep, works in my case, thanks.