Negative offset property value not working
See original GitHub issuescroller.scrollTo(elementToScrollId, {
offset: -200,
});
this is not working because of this source code line:
let scrollOffset = utils.scrollOffset(containerElement, target) + (props.offset || 0);
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:5 (2 by maintainers)
Top Results From Across the Web
jQuery Offset returns negative value - Stack Overflow
Just use dom offsetTop property. That will be a correct position despite whatever scrolling has happened before. $( something )[0].
Read more >Cannot offset position of labels on map grid in La... - Page 3
I've been trying to do it with the following steps: Format Map Grid > Select 'Labels' from dropdown > Properties > Position >...
Read more >offset - CSS: Cascading Style Sheets - MDN Web Docs
The offset CSS shorthand property sets all the properties required for animating an element along a defined path.
Read more >outline-offset - CSS-Tricks
The outline-offset property in CSS offsets a defined outline from an element's border edge by a specified amount. An outline, which is ...
Read more >Negative margins in CSS - QuirksBlog - QuirksMode
It is possible to give margins a negative value. ... Remember: margin collapsing does not work on margin-left and -right; just on -top...
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 Free
Top 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
Any update on that one ? 😢
FYI - It looks like the negative offset works fine, *as long as you’re using the Scroll.scroller to scrollTo an Element.
If you use Scroller.animateScroll and input a negative Offset, it does not seem to function. Actually, it seems like the animateScroll has some other issues as well.
For instance, say you have an index splash screen, where each section (div) takes up 100vw and 100vh. If you’re at the top of the page, and you click on something that calls animateScroll to the next section in line, it works fine. However, if you scroll down even a little, and then initiate the animateScroll, this does not function properly.