Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
129
rated 0 times [  130] [ 1]  / answers: 1 / hits: 130895  / 15 Years ago, thu, may 7, 2009, 12:00:00

Properties document.body.clientHeight and document.body.clientWidth return different values on IE7, IE8 and Firefox:



IE 8:



document.body.clientHeight : 704 
document.body.clientWidth : 1148


IE 7:



document.body.clientHeight : 704 
document.body.clientWidth : 1132


FireFox:



document.body.clientHeight : 620 
document.body.clientWidth : 1152


Why does this discrepancy exist?

Are there any equivalent properties that are consistent across different browsers (IE8, IE7, Firefox) without using jQuery?


More From » css

 Answers
70

This has to do with the browser's box model. Use something like jQuery or another JavaScript abstraction library to normalize the DOM model.


[#99580] Saturday, May 2, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sherryd

Total Points: 254
Total Questions: 92
Total Answers: 89

Location: Equatorial Guinea
Member since Sun, Feb 14, 2021
3 Years ago
;