Streaming live at 10am (PST)

"Go back" location problem with hash


I have a website with a lot of products. I’m using anchor IDs to navigate to different sections, both within the same page and from other pages.

Use case:

When I navigate back with the browser button or a link, using this code

var Webflow = Webflow || [];
Webflow.push(function() {
  $('a.product-back-link').click(function() {
    history.back(1); return false;

it takes me back to the previous page and then animates back to #section. This is pretty annoying if you’ve scrolled far from the section.

I do understand why this is happening. But, is there a way to take me back to the previous page and stay on the last location, as it would do if I wouldn’t use the anchor ID’s?

My English is awful, so I really hope anyone understands :sweat_smile: I would really appreciate any help. Thank you, guys!


Possible solution here

1 Like

Wow! Thank you. I will have a look and see if I come up with something.