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

Small improvements #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

albertogasparin
Copy link

Hi Joe,
I've tweaked your code to better fit my needs, but I think my changes could interest you.

  1. I've fixed a small lag that sometimes occurs on the first scroll (because startTopScroll was undefined)
  2. I've changed the method to get the height (from offsetHeight to clientHeight).
    If the element has a border, your scroll function will do it wrong.
  3. I've added the ability to prevent the scroll if the element is smaller than the visible area.
    It is useful if you want a correct behavior in a WebView app (preventing outer page scroll).

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.

3 participants