CSS transform: scale does not change DOM size?

前端 未结 1 1788
遥遥无期
遥遥无期 2020-12-20 15:25

Container\'s DOM width after transform is the same as before transform?

Why?

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


        
相关标签:
1条回答
  • 2020-12-20 15:44

    Transforms don't affect the layout — or more precisely the box model — of an element. They are purely cosmetic. From the 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 getClientRects() and getBoundingClientRect(), which are specified in [CSSOM-VIEW].

    0 讨论(0)
提交回复
热议问题