CSS3 how to calculate height and width after scale

2019-06-16 00:20发布

问题:

This question already has an answer here:

  • Retrieve width/height of a css3 scaled element 4 answers

Is there any jQuery solution that to find exact display height of the -webkit-transform: scale(0.7851);

the scale value may vary that is why looking for proper solution

Tested these options unfortunately didn't find solution yet :(

height()
innerHeight()
outerHeight()
outerHeight(true)

I think this issue only can fix one the basis of mathematics ;)

回答1:

Use getBoundingClientRect().

element.getBoundingClientRect().height

See DEMO.