getBoundingClientRect().width 和 offsetWidth的结果基本是一致的。
但是当元素进行了transfrom 操作,getBoundingClientRect().width展示的是操作后的真实渲染宽度。而offsetWidth是未transfrom 操作的宽度。
image.png
image.png
getBoundingClientRect().width 和 offsetWidth的结果基本是一致的。
但是当元素进行了transfrom 操作,getBoundingClientRect().width展示的是操作后的真实渲染宽度。而offsetWidth是未transfrom 操作的宽度。
本文标题:getBoundingClientRect().width和of
本文链接:https://www.haomeiwen.com/subject/drazhrtx.html
网友评论