title: jquery Scroll to class name
body: <p>I have the Html code like below,</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div data-stored="storenow" data-save="save" class="saveIcon" data-unique="game"&gt;Save&lt;/div&gt;
  </code></pre>
  
  <p>And I write the jquery to scroll to the gameNo 456 like below. </p>
  
  <pre class="lang-js prettyprint-override"><code>var container = $("html,body");
  var scrollTo = $(this).find('.saveIcon').attr('data-unique', 456);
  
   container.animate({
      scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop()
  });
  </code></pre>
  
  <p>I am using jQuery version 1.9. I am getting error in console:</p>
  
  <blockquote>
    <p>Cannot read property 'top' of undefined </p>
  </blockquote>
  
  <p>Is that not possible to scroll to class name instead of id? </p>
  
  <p>But it is working fine in Firefox. But not in chrome or IE.</p>
  
  <p>I try to find the solutions from stackoverflow. But all other solutions are different than my case.</p>