Jump to content
Search Community

ScrollSmoother and dynamically loading content

kodralex test
Moderator Tag

Recommended Posts

First off, apologies if this topic has already been covered (I did look back over previous forum posts and read through the documentation). But I couldn't see anything. Pretty simple problem Content on my page is being loaded via AJAX, and this seems to make the default ScrollSmoother get stuck. I figured it's happened because onload ScrollSmoother is figuring out the page height, and after this is done, the ajax is being called and thus changing the page height. 

 

Am I guessing I need to reinitialize ScrollSmoother after the AJAX call has been made?

 

Here's an example page: https://optimus.devweb.site/news/

 

Thanks

  • Like 1
Link to comment
Share on other sites

Thanks @Cassie that is what I was looking for. If anyone else reads this and are using AJAX load more plugin to load blog posts etc on a WordPress site you can use this function to solve the issue:

 

window.almComplete = function(alm){
	ScrollTrigger.refresh();
};

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...