Prevent Scroll Jump on Page Transition (different behavior in Chrome/Safari vs Firefox)
-
Hi @arminunruh ,
I’m trying to customize the page transitions on my site and I’m running into a scroll issue during AJAX navigation.
When switching pages, LayTheme keeps the scroll position from the previous page and then scrolls back to the top. I would like each new page to start at the top immediately, without showing any visible scroll movement.
What makes it confusing is that the behavior differs by browser:
• Firefox: works fine – the transition uses opacity and the new page appears only after it’s already at the top
• Chrome & Safari: the new page appears at the old scroll position first and then visibly scrolls to the top afterwardsSo users can actually see the page jumping/scrolling up, which looks off.
Things I already tried:
• window.scrollTo(0,0) in the Head
• forcing .scrollTop = 0 on LayTheme containers
• overriding window.scrollTo()
• custom JS on page transition eventsNone of these worked.
In DevTools I can see that frontend.app.min.js calls scrollTo() after the new page loads, which seems to override everything.My questions:
1. Is there a built-in LayTheme option to disable this automatic scroll behavior?
2. Is there a recommended way to force every new page to start at scroll position 0 with AJAX transitions?
3. Why does Firefox behave differently from Chrome/Safari here?Thanks a lot for your help!
-
hey! do you have a link?
i will fix it! i would just need to take a look at your site to see why it happens <3 -
https://energiebuero-hetschko.de/leistungen/
PW is: test -

i think its because of this.if you remove this css, it will work without adding any extra code.
this css should be in: lay options -> custom css & htmlif you want smooth scrolling you can enable smooth scroll in lay options!

I also code custom websites or custom Lay features.
💿 Email me here: 💿
info@laytheme.com
Our Web Development company: 100k.studio
Want to tip me? https://www.paypal.com/paypalme/arminunruh
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it