Closed
Description
👉 Conclusion / Feature Specification
The discussion in this issue has resulted in a decision to implement the following API method:
// get scroll progress
// returns a number representing % scrolled of scrollable distance.
// 0 is start position and 1 is end position
embla.scrollProgress()
Example Usage
embla.on('scroll', () => {
console.log(`Current progress is: ${embla.scrollProgress() * 100}%`)
}
CodeSandbox
See example usage.
Special thanks
@xiel for discussing this and sharing your thoughts and ideas.
@welteki for the nice demonstration.