当前位置 : 主页 > 网页制作 > css >

CSS转换:规模不会改变DOM大小?

来源:互联网 收集:自由互联 发布时间:2021-06-13
变换后容器的DOM宽度与变换前相同? 为什么? var theScale = aNumber;var containerWidth = theContainer.width();alert(containerWidth);// and the other prefixes, as welltheContainer.css("-webkit-transform", "scale(" + theScale
变换后容器的DOM宽度与变换前相同?

为什么?

var theScale = aNumber;
var containerWidth = theContainer.width();
alert(containerWidth);

// and the other prefixes, as well
theContainer.css("-webkit-transform", "scale(" + theScale + ")");

containerWidth = theContainer.width();
alert(containerWidth);   // the same value ???
变换不会影响元素的布局 – 或者更确切地说是框模型.它们纯粹是化妆品.从 spec:

Note: Transformations do affect the visual layout on the canvas, but have no affect on the CSS layout itself. This also means transforms do not affect results of the Element Interface Extensions 07001 and 07002, which are specified in 07003.

网友评论