title: jQuery scroll to ID from different page
body: <p>I was trying to use jQuery's page scroll inside some pages and could successfully make a smooth page scroll. The only problem I have now is when attempting to do that from different page. What I mean by that is if I click on a link in a page, it should load the new page and then scroll to the specific div element.</p>
  
  <p>Here is the code I used to scrolling inside the page:</p>
  
  <pre><code>var jump=function(e)
  {
         //prevent the "normal" behaviour which would be a "hard" jump
         e.preventDefault();
     //Get the target
     var target = $(this).attr("href");
     //perform animated scrolling
     $('html,body').animate(
     {
             //get top-position of target-element and set it as scroll target
             scrollTop: $(target).offset().top
     //scrolldelay: 2 seconds
     },2000,function()
     {
             //attach the hash (#jumptarget) to the pageurl
             location.hash = target;
     });
  
  }
  
  $(document).ready(function()
  {
         $('a[href*=#]').bind("click", jump);
         return false;
  });
  </code></pre>
  
  <p>I hope the idea is clear.</p>
  
  <p>Thanks </p>
  
  <p><strong>Very important Note</strong>:
  This code I posted above works great inside the same page, but what I'm after is to click a link from one page and go to another one and then scroll to the target. I hope it is clear now. Thanks </p>