Jump to content
Search Community

Scroll Smoother reload error

MagicMaciej test
Moderator Tag

Recommended Posts

Hello.
I trying to add scroll smoother to wordpress site. When I have document at top and reload page than it loads with document scrolled down few humdred pixels. Any ideas? Is it becuase I append content into scroll container?
https://darraghkerrigancreative.ie/gormleyconstruction/


    

document.addEventListener('DOMContentLoaded', () => {
var outerContainer = document.createElement('div');
    outerContainer.className = 'scrollon';
    var outerContainerh = document.createElement('div');
    outerContainerh.className = 'scrollon-h';

    const container1 = document.querySelector('.l-canvas');
    const container2 = document.querySelector('.l-footer');

    outerContainerh.appendChild(container1);
    outerContainerh.appendChild(container2);

 
    outerContainer.prepend(outerContainerh);
    document.body.prepend(outerContainer);
        ScrollSmoother.create({
        wrapper:'.scrollon',
        content:'.scrollon-h',
  smooth: 1, 
  effects: true,
  smoothTouch: 0.1,
    normalizeScroll: true
});

});


 

Link to comment
Share on other sites

Hi,

 

I've been fiddling with the live page for a while and can't seem to replicate the issue. Are there any specific steps to reproduce the problem? Maybe I'm missing something obvious here 🤷‍♂️

 

I tested in the latest Chrome and Firefox on Ubuntu 22 & 20 without any luck.

 

Sorry I can't be of more assistance 🙏

Happy Tweening!

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...