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

bouncefix will make fastclick.js disable #7

Open
YongX opened this issue Jun 19, 2015 · 2 comments
Open

bouncefix will make fastclick.js disable #7

YongX opened this issue Jun 19, 2015 · 2 comments

Comments

@YongX
Copy link

YongX commented Jun 19, 2015

Hello,
I'm using fastclick.js together with bouncefix.js, they both work well for me, except when I reach the top or the bottom of my web, it looks like bouncefix.js will make a little scroll(1px), and that will make fastclick not work.
Any suggestion?

@burnedikt
Copy link

There is a fix for this problem, though it's a bit hacky: ftlabs/fastclick#357

@dondevi
Copy link

dondevi commented Aug 20, 2015

@YongX Here is a Hack you can try:

  //
  // Keep scrool from hitting end bounds
  //
  utils.scrollToEnd = function (el) {
    var curPos = el.scrollTop, height = el.offsetHeight, scroll = el.scrollHeight;
    // If at top, bump down 1px
    if (curPos <= 0) {
      el.fastClickLastScrollTop = el.scrollTop = 1;
    }
    // If at bottom, bump up 1px
    if (curPos + height >= scroll) {
      el.fastClickLastScrollTop = el.scrollTop = scroll - height - 1;
    }
  };

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

3 participants