Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Prevent Scroll Jump on Page Transition (different behavior in Chrome/Safari vs Firefox)

Prevent Scroll Jump on Page Transition (different behavior in Chrome/Safari vs Firefox)

Scheduled Pinned Locked Moved General Discussion
5 Posts 2 Posters 33 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jayjay123
    wrote last edited by
    #1

    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 afterwards

    So 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 events

    None 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!

    1 Reply Last reply
    0
    • arminunruhA Offline
      arminunruhA Offline
      arminunruh
      Global Moderator
      wrote last edited by
      #2

      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

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jayjay123
        wrote last edited by
        #3

        https://energiebuero-hetschko.de/leistungen/
        PW is: test

        1 Reply Last reply
        0
        • arminunruhA Offline
          arminunruhA Offline
          arminunruh
          Global Moderator
          wrote last edited by
          #4

          Screenshot 2026-02-04 at 10.31.58.png
          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 & html

          if you want smooth scrolling you can enable smooth scroll in lay options!

          Screenshot 2026-02-04 at 10.33.36.png

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jayjay123
            wrote last edited by
            #5

            ah perfekt! Thanks so much!! Worked! <3

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            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:
            1. When using a WordPress Cache plugin, disable it or clear your cache.
            2. Update Lay Theme and all Lay Theme Addons
            3. Disable all Plugins
            4. 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:
            1. Post a link to where the problem is
            2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
            3. If the problem is difficult to explain, post screenshots / link to a video to explain it
            Online Users
            Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
            laytheme.com
            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Recent
            • Tags
            • Popular
            • Users
            • Search