-
AuthorPosts
-
May 19, 2023 at 11:23 pm #1407989
Hi
I have a page featuring a Portfolio Gallery element with around 90 items. If you click into any of them then go back again n your browser (mobile or desktop) it returns back to the top of the page instead of the place you where you were at – any idea how to prevent this?
Page in question: Page Link
Thanks in advance
EdMay 21, 2023 at 7:58 pm #1408080Hey Swarez,
Thanks for the link to your page, I believe that if you used a different element than the masonry element this would work for you but the masonry element builds the grid after the page load so the height of the page changes. Try watching the scroll bar when you click to a page and then use the back button, on load the page shows the scroll bar scorlled as before but then the masonry element builds the grid changing the page height.
Try using the Blog element with the grid layout showing your portfolio items and see if that helps, in my test on my demo pages scrolling to a place on the page and then clicking to another page and then back again the page returns the same place. My research on stackoverflow.com says: If the content is loaded after page “load” event firing, then the back button would not take you back to the position you were. Because the browser scrolls before the ‘load’ event. and this is the case with the masonry element.
The Page scroll to id plugin suggests it may help with this, but I tend the think it doesn’t mean in this situation, but you could try it or perhaps a different plugin.
I think changing your element is probably the best option.
I note that your masonry element loads slowly for me, if you are using a plugin to lazy load try disabling it to see if it will load faster, this may help some.Best regards,
MikeMay 21, 2023 at 9:58 pm #1408087Hi Mike
Thank you so much for taking the time and energy to fact check the issues with the Masonry element. i very much appreciate it.
The Blog element was no good so I have reverted back to the Portfolio element and that now remebers where you came from, so to speak. The styling isn’t great and the options for spacing aren’t there but it’s a workaeound for now.
Thank you again for your patience and time.
Regards
EdMay 21, 2023 at 10:08 pm #1408089Hi,
Glad to hear that you have found a workaround, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Portfolio page always scrolls back to the top’ is closed to new replies.