Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting the effective content height of a window onload #1640

Closed
andynuss opened this issue Oct 29, 2016 · 1 comment
Closed

getting the effective content height of a window onload #1640

andynuss opened this issue Oct 29, 2016 · 1 comment

Comments

@andynuss
Copy link

I am using env() to load various news articles on common news sites, such as yahoo, as a first test of jsdom, and my desire to autoscroll my own documents' windows to the very bottom of the viewable content.

I am using the technique described in http://stackoverflow.com/questions/1145850/how-to-get-height-of-entire-document-with-javascript to get the scrollHeight of a document 5 seconds after the window onload callback commences, and my Height(window) function as follows return NaN. Is this supposed to work?

function Height (window) {
    var body = window.document.body,
        html = window.document.documentElement;

    var height = Math.max(body.scrollHeight, body.offsetHeight,
                          html.clientHeight, html.scrollHeight, html.offsetHeight);
    return height;
}
@Sebmaster
Copy link
Member

Sebmaster commented Oct 31, 2016

Since jsdom does not do layouting, you can't get (the correct) scrollHeight of anything.

@domenic domenic closed this as completed Apr 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants