title: smooth scrolling to a div in a different html page
body: <p>I have a menu bar in each of the pages and when I click on one of the sub-items I want the page to redirect to the other html and scroll smoothly to that specific div.
  I am using this code to have it scroll smoothly within the divs of one page:</p>
  
  <pre><code>$(function() {
    $('a[href*=#]:not([href=#])').click(function() {
      if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') &amp;&amp; location.hostname == this.hostname) {
  
        var target = $(this.hash);
        target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
        if (target.length) {
          $('html,body').animate({
            scrollTop: target.offset().top
          }, 1000);
          return false;
        }
      }
    });
  });
  </code></pre>
  
  <p>Is there a way to modify this code so that I am able to what I am asking?</p>