I have some calculations that rely on window.innerHeight
. But as I have found out this is not available in any IE before IE9. All the other options I have looked at don't even come close to the figure I get when I use window.innerHeight
.
Does anybody have a work around?
You might want to try:
Or can use jQuery's
.height()
method:Use following in your
document.ready
and defineinnerHeight
explicitly.I searched on because n o n e of the here posted functions seemed to work, i always got the windowviewheight not the documents full height...
this works in all browsers I've tested...also iexplore 8:
Javascript method to get full window height..:
Javascript methods to get full document height..:
or
Javascript methods to get visible document area height..:
this is height of window without bars.
jQuery methods to get visible document area height and window without bars area height too..:
or
jQuery methods to get full document height..:
or
that's all, I hope will help you :)
I made a simple shim for IE8 and others:
window.innerWidth
window.innerHeight
window.scrollX
window.scrollY
document.width
document.height
559 bytes
For updates, take a look at this gist: yckart/9128d824c7bdbab2832e