clientHeight/clientWidth returning different values on different browsers

前端 未结 9 1298
有刺的猬
有刺的猬 2020-11-27 19:14

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

IE 8:



        
9条回答
  •  清酒与你
    2020-11-27 19:43

    What I did to fix my issue with clientHeight is to use the clientHight of the controls firstChild. I use IE 11 to print labels from a database and the clientHeight that worked in IE 8 was returning the height of 0 in IE 11. I found a property in that control that was listed as firstChild and that had a property if clientHeight and actually had the height I was looking for. So if your control is returning a clientSize of 0 take a look at the property of its firstChild. It helped me...

提交回复
热议问题