javascript - How to get the height of an element accurately to decimal places in js (non-jq)
怪我咯
怪我咯 2017-05-16 13:20:53
0
1
525

Use offsetHeight to get the height of the element and find it is an integer ,

But in the console of Google Chrome, you can see that the height actually has decimals,

Due to the precise scrolling operation, it must be precise, please help.

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
曾经蜡笔没有小新

After looking at the source code of jq, I found that the height returned by getComputedStyle is accurate to decimals

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template