Created
July 23, 2015 12:15
-
-
Save Razenbull/8c5bfc7d4bbd504be129 to your computer and use it in GitHub Desktop.
Scroll document to a target
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
/** | |
* | |
* @param $target | |
* @returns {boolean} | |
*/ | |
function scrollTo($target) { | |
console.log('trigger scrollTo()'); | |
$('html, body').animate({ | |
scrollTop: $target.offset().top | |
}, 500); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment