I can get window.innerHeight on Chrome.
1, How to get this property on IE7 via pure JS?
2, How to get this property on IE7 via jQuery?
Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Pure JS is difficult; so you’ll need a script for that:
http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/
jQuery on the other hand, is as simple as typing this:
JS Fiddle link for a live demo
Note: The window size is the size of the result section in JS Fiddle.
Update 1
I found a script that finds the scrollbar size from JQuery Dimensions should have a method to return the scrollbar size:
The only problem left is it always adds the scrollbar width & height to the dimensions, regardless if there is a scrollbar or not. One solution to fix this problem is to detect when there is overflow in a web page, and at what dimension (vertical or horizontal).