coderpanda
12/19/2019 - 2:11 PM

function to scroll to a specific element in the page

//replace #fromA with your button/control and #toB with the target to which you wanna scroll to. 
$("#fromA").click(function() {
   $("html, body").animate({ scrollTop: $("#toB").offset().top }, 1500);
   console.log('executed scrollToElement');
   return true;
});