Streaming live at 10am (PST)

Back Button not working


#1

Hello,
my back button is not working properly. The link url I entered is:

`javascript:history.back();

You can find it on my “Information” site in the Header-Symbol, just visible for the two last viewports (named “.close-link”):

Further probably useful information:

• I’ve discovered in Chrome’s Inspector that when I use its element-pick-tool, I can’t pick the header’s divs.

• To keep my header as an symbol, I added the back button and “display: none” it on every site except this one site where it has to keep staying. But even when the button is displayed regular without custom code the back-button doesn’t work. So this won’t matter.


#2

Hi @wedo

Can you try to put this code in your before body tag:

<script>
var Webflow = Webflow || [];
Webflow.push(function() {
  $('a.back-button').click(function() {
    history.back(1); return false;
  });
});
</script>

Then create a button and simply give it the class back-button

I use this code on a couple sites and it works perfectly!
Hope this helps!


#3

Hey @donaldsv

I did. Now it isn’t clickable, anymore.


#4

Can you paste the code in your project settings instead of the page settings?


#5

I did and it is still not clickable :-/


#6

Here’s a working example

https://back-button.webflow.io/

https://preview.webflow.com/preview/back-button?utm_source=back-button&preview=7c5d5ded0d19a499c937349cfbdf5d9a

Maybe you need to remove the ‘close’ ID from your button?


#7

Have a look at this post. I had the same problem.