Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Navigate to the last scroll position when coming back to the homepage

    General Discussion
    4
    8
    538
    Loading More Posts
    • 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
      Johan last edited by

      After viewing a projet, I would like to come back to the homepage previous scrolled position when I press my browser back button (history.back()). Since I have a lot of projects displayed on my home, it's quite annoying for the user to come back to the top of the page.
      Is there a way I can get around this? I guess using Lightbox addon would do the job, but I would prefer having one page (with a proper url) per project.
      If anyone had any idea it would be super nice !
      Thanks a lot
      Johan

      1 Reply Last reply Reply Quote 0
      • J
        Johan last edited by Johan

        Any clue @mariusjopen ? It's for Simon Koy's website http://simonkoy.de

        1 Reply Last reply Reply Quote 0
        • arminunruh
          arminunruh Global Moderator last edited by

          Hey Johan!

          Oh, so normally this works, but only on pages where theres no project thumbnail overview grid.

          I need to improve this!

          J 1 Reply Last reply Reply Quote 0
          • J
            Johan @arminunruh last edited by

            @arminunruh Thanks a lot for your answer. Is there a trick I should use until you implement this functionality?

            1 Reply Last reply Reply Quote 0
            • J
              Johan last edited by Johan

              I tried something like :

              jQuery(document).ready(function($) {
                 $('a.thumb').on('click', function(){
                    sessionStorage["scrollPosition"] = $(window).scrollTop();
                 });
                 $(window).scrollTop(sessionStorage["scrollPosition"]);
                 sessionStorage.clear();
              });
              

              but it doesn't work.

              1 Reply Last reply Reply Quote 0
              • mariusjopen
                mariusjopen Global Moderator last edited by

                Hi @Johan
                have a look how to deal with Javascript here:
                http://laytheme.com/documentation.html#custom-javascript

                I hope that will work out for you.

                All the best!

                Marius

                www.mariusjopen.world

                J 1 Reply Last reply Reply Quote 0
                • J
                  Johan @mariusjopen last edited by

                  @mariusjopen Thanks a lot. I will find a way !

                  1 Reply Last reply Reply Quote 1
                  • L
                    lukaszlive last edited by

                    Hi Johann,

                    did you made it work .. searching for a solution here. THX Lukasz

                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post

                    Before you post

                    Use the Search Feature. Maybe there is already a solution to your issue.

                    1. Update Lay Theme and all Lay Theme Addons
                    2. Disable all Plugins
                    3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
                    4. Now see if your problem solved itself
                    5. Go here, see if your problem is listed here:
                    Troubleshooting

                    When you post:
                    1. Post a link to where the problem is
                    2. If the problem is difficult to explain, post screenshots / link to a video to explain it

                    Thanks!

                    Online Users

                    S
                    S
                    A

                    Recent Topics

                    • S

                      New fade-in / opacity bug?

                    • A

                      Unable to update lay theme / to login wp admin

                    • A

                      New button feature not available

                    • S

                      Theme crashed - because of Polylang?

                    laytheme.com