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

Way to destroy and rebuild smartscroll? Ajax use cases? #38

Open
affinitycreative opened this issue Sep 1, 2017 · 1 comment
Open
Labels

Comments

@affinitycreative
Copy link

affinitycreative commented Sep 1, 2017

Hello! Is there a way to disable / re-enable smartscroll when content is pulled in dynamically?

Do you have any knowledge of ajax/dynamic use cases? i.e. pulling in a page that uses smartscroll?

Thanks!

@d4nyll
Copy link
Owner

d4nyll commented Sep 1, 2017

Do you have a more solid example?

Smartscroll works by binding functions to window, so the most naive way is simply to unbind all the window events.

$(window).unbind();

But this might affect other libraries you're using. So you might have to run this before other libraries are ran.

To re-enable smartscroll, just run the initialisation script again.

$.smartscroll(options);

@d4nyll d4nyll added the question label Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants