Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple progress bar on the same page? #3

Open
geosigno opened this issue Sep 22, 2017 · 5 comments
Open

Multiple progress bar on the same page? #3

geosigno opened this issue Sep 22, 2017 · 5 comments

Comments

@geosigno
Copy link

Would it be possible to use 2 or more progress bars in the same page.

For example on a page with 3 articles, each one should have its progress bar. So if the first article is finish, the progress start again with the second . Also if you scroll up, then the progress bar adapt accordingly?

@jeremenichelli
Copy link
Owner

With the last version it's possible to create as many progress observers as you want, though right now it's not possible to add offsets so they track specific parts of the page, but it's something I'm working right now and expect to release soon.

@geosigno
Copy link
Author

That's a good new :)
Any idea of the release date?

@jeremenichelli
Copy link
Owner

Not yet, I gave it a try a while ago but the solution was super buggy.

I hope to have the time to try again soon.

@geosigno
Copy link
Author

geosigno commented Sep 29, 2017

I found a way, I put the code here if it can help you to add this feature if your library ;)

https://codepen.io/anon/pen/pWwgyQ

@jeremenichelli
Copy link
Owner

jeremenichelli commented Sep 29, 2017

Wow! Really cool @geosenna, I'm trying to come up with a way that you can pass coordenates to the observer so it tracks specific areas of the page.

Something like:

const observer = new scrollProgress({
  top: 200,
  bottom: 600,
  onUpdate(x, y) {
    console.log(x, y)
  } 
})

So this way it serves to all purposes, not only reading progress bars. Another option would be to optionally pass a DOM node and track that, update on resize.

Food for thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants