【问题标题】:CSS3 // calculate "real pixels" of an element after a matrix3d transformCSS3 // 在 matrix3d 变换后计算元素的“真实像素”
【发布时间】:2014-12-27 16:31:03
【问题描述】:

假设我使用 matrix3d 变换放大一个元素,如何获得该元素的最终尺寸(以像素为单位)?

【问题讨论】:

    标签: css matrix transform


    【解决方案1】:

    使用

    Element.getBoundingClientRect()

    https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect

    如果你使用 jQuery,那么$(CSS selector)[0].getBoundingClientRect()

    将返回{height:?,width:?,top:?,left:?}对象数据

    【讨论】:

      猜你喜欢
      • 2018-04-19
      • 2013-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-06-24
      • 1970-01-01
      • 2012-02-23
      • 1970-01-01
      相关资源
      最近更新 更多