d4nyll / smartscroll

jQuery plugin for scrolljacking and auto-hashing
https://d4nyll.github.io/smartscroll/
MIT License
257 stars 45 forks source link

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

Open affinitycreative opened 7 years ago

affinitycreative commented 7 years ago

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 commented 7 years ago

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);