How to scroll within a div with jQuery animate() function?
I have this code snippet which scrolls the entire body to a particular
location Ë
$('html, body').animate({ scrollTop: offset }, 800, 'swing');But what if i
want to scroll to a particular location within a div like this Ë
$('#div-id').animate({ scrollTop: offset }, 800, 'swing');I tried this way
but its not working, can you tell me where i am going wrong?
No comments:
Post a Comment