参考文章 (opens new window)
getBoundingClientRect().width 和 offsetWidth的结果基本是一致的。 但是当元素进行了transfrom 操作,getBoundingClientRect().width展示的是操作后的真实渲染宽度。而offsetWidth是未transfrom 操作的宽度。
← absolute固定定位 微信小程序样式问题 →