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

Threshold setting #18

Closed
moniuch opened this issue Jan 9, 2019 · 1 comment
Closed

Threshold setting #18

moniuch opened this issue Jan 9, 2019 · 1 comment

Comments

@moniuch
Copy link

moniuch commented Jan 9, 2019

Please provide threshold parameter/input (on the snScrollSpy directive?), as if answering the question: "what is the threshold value to consider an element as active?"

In my use case I would see two types of units (for both height and width) that I would like to express the threshold:

  • vh/vw (how much of vieport dimension does it have to occupy)
  • % (how much of its own clientWidth/clientHeight does the element have to reveale to consider it active)

There should probably also be a parameter to specify whether the calculation should include/exclude margins/padding.

In the below scenario (we see a fixed, semi-transparent navbar above the green line)

chrome_2019-01-09_21-03-56

the content is scrolled to the very bottom (ie. bottom of last section, Section 4), and as you see, the link for that section is still not activated. With the proposed feature, if we specified that 60% of the height is enough to consider an element active, the link would get highlighted, which would correspond with the intuitive perception.

@edoparearyee
Copy link

Closing as it's a dup of #1

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

No branches or pull requests

2 participants