title: How to smooth scroll to an id after clicking a link from another page
body: <p>Say that I have a link in a page,</p>
  
  <pre><code>&lt;a href="https://example.com/#sample"&gt;&lt;p&gt;Click Me&lt;/a&gt;
  </code></pre>
  
  <p>Clicking on the click gets you to the link in the href attribute. But because of how the gods work, it snaps immediately to the id in that page.</p>
  
  <p>What I want to happen is that the page should not immediately go to the id, but start at the top of the page, and then smooth scroll to the id.</p>
  
  <p>On a side note, the sticky menu is in the way, when it snaps to the id, its overlapped by the menu (one of the main reasons i want it to scroll instead).</p>
  
  <p>jQuery isn't my strong suit.</p>
  
  <p>Thank you to anyone who can help.</p>
  
  <p><strong>EDIT</strong>
  I don't think I worded this properly.
  The link with the a tag is on a different page than its target.
  For example:</p>
  
  <p>The Homepage has the link</p>
  
  <pre><code>&lt;a href="https://example.com/anotherPage/#sample"&gt;&lt;p&gt;Click Me&lt;/a&gt;
  </code></pre>
  
  <p>There's a page called anotherPage that I would like scrolling to work on.</p>
  
  <p>Sorry for not making this not detailed enough.</p>
  
  <p>Thanks to anyone who replies.</p>