Last active
June 17, 2018 20:53
-
-
Save JokingChicken/6947aa770c9ec33e3285b82af458c3e4 to your computer and use it in GitHub Desktop.
get the real scroll height of div
This file contains 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
<script> | |
// calculate max scroll top position (go back to top once reached) | |
var maxScrollPosition = element.scrollHeight - element.clientHeight; | |
// example | |
element.scrollTop = maxScrollPosition; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment