##As shown in the picture, shouldn’t I get 55.17?
$('.pr-tab').get(0).getBoundingClientRect().height gets the real dataFor details, please refer to http://stackoverflow.com/ques...
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
outerHeight()
I usually use element.offsetHeight; && element.offsetWidth in native JS. Reference link https://developer.mozilla.org...
Give a delay. You have started calculating the height before the dom is inserted. Give a delay of 50ms before getting the value
$('.pr-tab').get(0).getBoundingClientRect().height gets the real data
For details, please refer to http://stackoverflow.com/ques...
The document says that the
outerHeight()
method can only return an integer value. Your 55.17 was rounded off and only returned 55I usually use element.offsetHeight; && element.offsetWidth in native JS. Reference link https://developer.mozilla.org...
Give a delay. You have started calculating the height before the dom is inserted. Give a delay of 50
ms before getting the value