Last active
August 29, 2015 13:59
-
-
Save user24/10624859 to your computer and use it in GitHub Desktop.
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
// document.body.scrollTop = 1; // uncomment this line and it works every time. | |
console.log(daysTop); // 15141 | |
console.log($(document).height()); // 54005 | |
document.body.scrollTop = daysTop; | |
console.log(document.body.scrollTop); // 0, sometimes, in chrome (and the page doesn't move to 15141).... | |
/* | |
if I attach the above code to a click handler, then when the bug occurs, it occurs on | |
every click until I manually scroll the page, then it starts working. | |
I think it's relevant that the page is only that long because I'm creating new | |
elements via JS, then trying to scroll to them. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment