javascript CSS3如何计算缩放后的高度和宽度

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16467220/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 04:47:57  来源:igfitidea点击:

CSS3 how to calculate height and width after scale

javascriptjqueryhtmlcsswebkit-transform

提问by Mo.

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

是否有任何 jQuery 解决方案可以找到精确的显示高度 -webkit-transform: scale(0.7851);

the scalevalue may vary that is why looking for proper solution

scale值可能会有所不同,这就是为什么在寻找妥善的解决办法

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 ;)

我认为这个问题只能解决一个数学基础;)

回答by Antony

Use getBoundingClientRect().

使用getBoundingClientRect().

element.getBoundingClientRect().height

See DEMO.

演示