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

All scroll events triggered immediately on first screen #10

Open
m12y opened this issue Jun 18, 2019 · 0 comments
Open

All scroll events triggered immediately on first screen #10

m12y opened this issue Jun 18, 2019 · 0 comments

Comments

@m12y
Copy link

m12y commented Jun 18, 2019

I'm using the following code:

const scrollTracker = window.ScrollTracker();
scrollTracker.on({
  percentages: {
    every: [25]
  }
}, evt => {
  console.log("Scroll tracking:");
  console.log(evt.data.label);
  console.log(evt.data.depth);
});

As soon as the page loads, I get the following output immediately:

Scroll tracking:
25%
235
Scroll tracking:
50%
471
Scroll tracking:
75%
707
Scroll tracking:
100%
943

It seems to be considering the first visible window as 100%, because the height of my browser window is 943. Scrolling further down the page doesn't trigger any more events.

I'm using Chrome 74 on macOS 10.14, and it happens for all pages I try.

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

1 participant