Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

use window height for viewport height instead of document height #389

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DocX
Copy link

@DocX DocX commented Dec 2, 2013

translation from relative to absolute coordinates should be (as it is in documentation and also it is somehow logical) relative to browser's viewport edges. Thus viewport height is not document height but browser's window inner height.

translation from relative to absolute coordinates should be (as it is in documentation and also it is somehow logical) relative to browser's viewport edges. Thus viewport height is not document height but browser's window inner height.
@Prinzhorn
Copy link
Owner

There are other bits of code that use documentElement.clientHeight. Do you have a failing test case/example for the old code? Since all pages use html {height:100%} for overflow scrolling, both values are the same.

@DocX
Copy link
Author

DocX commented Dec 6, 2013

I was trying with it in simple html without CSS styles. So I had not height:100% on html. So if it is mandatory for the right function, it could be ok. IMHO I would still prefer window.innerHeight since it is more verbose about what it should be :)

@Prinzhorn
Copy link
Owner

I agree. Now we need to make it work in IE http://stackoverflow.com/questions/10173236/window-innerheight-ie8-alternative

E.g. window.innerHeight || documentElement.clientHeight but then there's not point in using it if IE still uses the old value (in case you didn't set HTML to 100% height, it will fail in IE I guess).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants