question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

👉 Specification (implemented)

// adds to current scroll progress
// accepts a number from 0 - 1 representing % to add to the current scroll progress
// scroll to target is smooth

embla.scrollBy(0.5)

As discussed here and here in issue #21.

Special thanks

@xiel for this feature request.

Please react with --> 👍 if you want this to be implemented.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
davidjerlekecommented, Feb 4, 2020

Hello Felix (@xiel),

I’m happy to announce that I’ve released the scrollBy() feature with version 2.7.0 🚀. I’ve not had time to add it to the README though, but I’ll add it as soon as possible.

How it works:

  • ScrollBy adds to scrollProgress as we discussed.
  • ScrollBy respects the scroll bounds when loop: false.

Let me know if it works as intended.

Cheers, David

1reaction
davidjerlekecommented, Jan 23, 2020

Hi again Felix (@xiel),

Thanks for getting back to me and I appreciate your clear explanation. We’re on the same page then, so I’ll let you know when I have something.

Best, David

Read more comments on GitHub >

github_iconTop Results From Across the Web

Window.scrollBy() - Web APIs | MDN
window.scrollBy() scrolls by a particular amount, whereas window.scroll() scrolls to an absolute position in the document. See also window.
Read more >
Window scrollBy() Method - W3Schools
The scrollBy() method scrolls the document by the specified number of pixels. Note. For the scrollBy() method to work, the document must be...
Read more >
Window scrollBy() Method
The scrollBy() method scrolls the document by the specified number of pixels. Note: For this method to work, the visible property of the...
Read more >
Javascript: scrollBy function executed on a div - Stack Overflow
The scrollBy function seems to be defined as window function, so I guess this is the problem, and it's working in FF not...
Read more >
Scroll Definition & Meaning - Merriam-Webster
especially : a spiral or convoluted form in ornamental design derived from the curves of a loosely or partly rolled parchment scroll.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found