scroll to element when clicked on code example
Example 1: how can when click buton scrool to another elemtn
$("button").click(function() {
$('html,body').animate({
scrollTop: $(".second").offset().top},
'slow');
});
// example: http://jsfiddle.net/ryXFt/3/
Example 2: scroll to specific div
$(window).scroll(function() {
$('html, body').animate({
scrollTop: $("#myDiv").offset().top
}, 2000);
});