Hi,
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:
- I go to a section by a link (ie mysite.com/subpage#section)
- Scroll down and click a product (mysite.com/subpage/subpage)
Problem:
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 I would really appreciate any help. Thank you, guys!
Video https://drive.google.com/file/d/14-HbuFgSeYkUuVOcrXXadu6M6TUi2YWa/view?usp=sharing