title: How to make a fixed "go to top" button on the page bottom, but above the (not fixed) footer?
body: <p>I have made a page (on Shopify) and I made there a fixed "go to top" arrow on the left bottom. It's okay, but when I scroll to the page bottom the arrow is will be in front of the footer, and I want it to stay above the footer.</p>
  
  <p>Here is the code that I use:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {   
    $(window).scroll(function() {
      if ($(this).scrollTop() &gt; 200) {
        $('.go-top').fadeIn(200);
      } else {
        $('.go-top').fadeOut(200);
      }
    });
  
    $('.go-top').click(function(event) {
      event.preventDefault();
  
      $('html, body').animate({scrollTop: 0}, 300);
    })
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.go-top {
    position: fixed;
    bottom: 2em;
    right: 0.5em;
    text-decoration: none;
    font-size: 40px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;a href="#" class="go-top"&gt; &amp;#x2191; &lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>