Created
May 25, 2017 06:45
-
-
Save alordiel/97be2c680a1a4f09f87798aac3c62262 to your computer and use it in GitHub Desktop.
JS - scroll to top function that accepts selector element for offset from top
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
function scrollToPlace(selector,scrollTime,additionalToOffset) { | |
jQuery('html, body').animate({ | |
scrollTop: jQuery(selector).offset().top - additionalToOffset | |
}, scrollTime); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment