Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • 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. Bug Reports
  3. Scroll position restoration not working as expected.

Scroll position restoration not working as expected.

Scheduled Pinned Locked Moved Bug Reports
11 Posts 3 Posters 116 Views
  • 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
    j0hSCh
    wrote on last edited by j0hSCh
    #1

    We're having difficulties with a Lay Theme installation: After navigating between pages (frontpage → project page and back), the restoration of the previous scroll position does not work as expected. Rather than returning to the position previously scrolled to, the page jumps to some arbitrary position (the same position every time).

    There is some custom frontend JavaScript running, but nothing concerning the scroll behavior. Disabling all custom code does not effect the problem, so I'm assuming this is not the problem.

    I've tried setting up custom handling for scroll position restoration but whatever the Lay Theme frontend code does in regards to this seems to be overriding it.

    How is Lay Theme handling scroll position restoration and what might cause this behavior?
    Any help with solving this would be great, navigating the site with this issue is very suboptimal.
    Thanks.

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

      whats the website url?

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

        Thanks for the quick reply. Here's the URL: http://patrick-desbrosses.com/

        1 Reply Last reply
        0
        • F Offline
          F Offline
          felix_rabe
          wrote on last edited by felix_rabe
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • J Offline
            J Offline
            j0hSCh
            wrote on last edited by
            #5

            Any ideas?

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

              can you send your website address, /wp-admin/ username and password and a link to this topic to info@laytheme.com?

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

                ah nevermind

                can you update lay theme now?
                then it should be fixed

                i just released a fix for it

                anyways, your lay theme version is quite outdated, please always read the blue boxes on the right and do these steps in there

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  j0hSCh
                  wrote on last edited by
                  #8

                  Hey hey,

                  thanks for the update. I've installed the patch and the problem seems mostly solved.

                  When using the site’s or the browser’s back button, navigation works as expected, the browsers returns to the previous scroll position. When clicking the home link (top left) however, the frontpage loads at some random scroll position. The same happens when reloading the frontpage.

                  Here’s a video showing the issue: https://drive.google.com/file/d/1eioLdKKg6C9ii18iHyPFCfZbj-DvnFi7/view?usp=sharing

                  I've tried disabling all custom code, clearing the cache, etc.

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

                    please disable all of your custom code and try again

                    lay options → custom html & css → turn off all

                    im pretty sure your custom code just pushes down the whole site, probably there is some big div that is position relative and then you set it to position absolute or fixed after the html has rendered

                    when using the back button, the previous scroll position will be restored

                    however, when just using a link to the frontpage, the scroll position will be 0
                    if u want the back button to restore scroll position, it should use history back:
                    https://developer.mozilla.org/en-US/docs/Web/API/History/back

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      j0hSCh
                      wrote on last edited by
                      #10

                      Found the issue, an older attempt to manually restore the scroll position was still firing. Everything works as it’s should. Thanks for the help

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

                        yea please always check the blue box "before you post"

                        nice website!

                        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

                        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
                        C
                        craigfeldspar
                        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