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. General Discussion
  3. Navigate to the last scroll position when coming back to the homepage

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

Scheduled Pinned Locked Moved General Discussion
8 Posts 4 Posters 722 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
    Johan
    wrote on last edited by
    #1

    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
    0
    • J Offline
      J Offline
      Johan
      wrote on last edited by Johan
      #2

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

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

        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
        0
        • arminunruhA arminunruh

          Hey Johan!

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

          I need to improve this!

          J Offline
          J Offline
          Johan
          wrote on last edited by
          #4

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

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

            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
            0
            • mariusjopenM Offline
              mariusjopenM Offline
              mariusjopen
              Global Moderator
              wrote on last edited by
              #6

              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
              0
              • mariusjopenM mariusjopen

                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

                J Offline
                J Offline
                Johan
                wrote on last edited by
                #7

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

                1 Reply Last reply
                1
                • L Offline
                  L Offline
                  lukaszlive
                  wrote on last edited by
                  #8

                  Hi Johann,

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

                  1 Reply Last reply
                  1
                  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
                  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