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
456

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

But in theconsoleof Google Chrome, you can see that the height actually hasdecimals,

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
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!