##As shown in the picture, shouldn’t I get 55.17?
滿天的星座2017-05-18 10:59:02
$('.pr-tab').get(0).getBoundingClientRect().height gets the real data
For details, please refer to http://stackoverflow.com/ques...
PHPz2017-05-18 10:59:02
Returns the value represented by an integer (excluding "px"), or null if the method is called on an empty collection.
The document says that the outerHeight()
method can only return an integer value. Your 55.17 was rounded off and only returned 55
ringa_lee2017-05-18 10:59:02
I usually use element.offsetHeight; && element.offsetWidth in native JS. Reference link https://developer.mozilla.org...
PHPz2017-05-18 10:59:02
Give a delay. You have started calculating the height before the dom is inserted. Give a delay of 50
ms before getting the value