This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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; | |
}); |