title: How to scroll within a div with jQuery animate() function?
body: <p>I have this code snippet which scrolls the entire body to a particular location &rarr;</p>
  
  <pre><code>$('html, body').animate({ scrollTop: 1000}, 800, 'swing');</code></pre>
  
  <p>But what if i want to scroll to a particular location within a div like this &rarr;</p>
  
  <pre><code>$('#div-id').animate({ scrollTop: 1000}, 800, 'swing');</code></pre>
  
  <p>I tried this way but its not working, can you tell me where i am going wrong?</p>
  
  <p>NOTE: The element <code>#div-id</code> has overflow:auto as one of its css rule.</p>