peachananr/onepage-scroll

afterScroll fires/triggers multiple times on all pages

sambunting opened this issue · 0 comments

I don't know if this is intentional or not, but for me using animations based off the page the user scrolls to, I see this more of an issue.

This only happens once. It doesn't occur twice. I can't seem to state why or when it happens either.

A way around this that I've found curtsey of this Stack Overflow post

if ($(".onepage-wrapper section:nth-child(1)").hasClass('active')) {
    ...
}

It still triggers several times, but this would only fire the methods/properties/actions relating to a specific page.