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

Support standard threshold option #12

Closed
wants to merge 1 commit into from
Closed

Support standard threshold option #12

wants to merge 1 commit into from

Conversation

sntran
Copy link
Contributor

@sntran sntran commented Oct 31, 2018

Can take either single value or an array of them, just as the Intersection Observer.

Also, switch to check entry.isIntersecting instead of comparing
against the threshold.

Can take either single value or an array of them, just as the Intersection Observer.

Also, switch to check entry.isIntersecting instead of comparing
against the threshold.
@mciastek
Copy link
Owner

mciastek commented Nov 22, 2018

What is a use case of updated threshold option? The idea behind sal.js is to have an abstraction upon Intersection Observer API, which allows you to easily animate elements on scroll. Adding more options and giving full access to Intersection Observer options is not a goal of this library.

@sntran
Copy link
Contributor Author

sntran commented Nov 26, 2018

This new threshold option is actually related to #11 , in which I need to know how much of intersection that occurs. Think parallax effect. Having a single number for threshold means I only know once when the intersection occurs.

I'm not adding more option or giving full access to IO here. Just make one existing option more usable.

@mciastek
Copy link
Owner

mciastek commented Dec 5, 2018

Think parallax effect. Having a single number for threshold means I only know once when the intersection occurs.

I think that sal.js is proper library to make parallax effect. Sal it's fine for simple in-out animation on scroll position. To be honest, I don't see a good use case for extended threshold option, and I think it can introduce some misunderstandings.

@sntran
Copy link
Contributor Author

sntran commented Dec 5, 2018

Sure. I'll close this. However, I would like to see an example of parallax with sal.js.

@sntran sntran closed this Dec 5, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants