title: Smooth Scrolling To Internal Links at other pages
body: <p>Im looking for a solution so i can smoothley scroll to an internal link on another html page.
  I've founnd code like this:</p>
  
  <pre><code>$(document).ready(function(){
  $('a[href^="#"]').on('click',function (e) {
      e.preventDefault();
  
      var target = this.hash,
      $target = $(target);
  
      $('html, body').stop().animate({
          'scrollTop': $target.offset().top
      }, 900, 'swing', function () {
          window.location.hash = target;
      });
  });
  </code></pre>
  
  <p>});</p>
  
  <p>But the problem with this code is that it doesnt work when you first put the html file name and than the internal link after the href. I have anchors like these:</p>
  
  <pre><code>&lt;a href='blabla.html#bla1'&gt;Blabla link&lt;/a&gt;
  </code></pre>
  
  <p>I can't find a solution to this problem. I've searched the whole internet for an answer but i couldn't find it. Is it possible to rewrite this code so i can use it with hyperlinks? I need to do this in jQuery.</p>