how to select a section id when scrolling in jquery code example
Example 1: jquery scroll to id
$('html, body').animate(
{
scrollTop: $($(this).attr('href')).offset().top,
},
500,
'linear'
)
Example 2: javascript go to div id
//slowScroll
function scroll() {
$('html, body').animate({
scrollTop: $("#divName").offset().top
}, 2000)};
window.onload = scroll;