jquery scroll offset code example
Example 1: jquery scroll to element
$("#button").click(function() {
$([document.documentElement, document.body]).animate({
scrollTop: $("#elementtoScrollToID").offset().top
}, 2000);
});
Example 2: jquery scrollHeight
$('#test')[0].scrollHeight