js中getBoundingClientRect的作用及兼容方案详解 1、getBoundingClientRect的作用getBoundingClientRect用于获取某个html元素相对于视窗的位置集合。执 getBoundingClientRect()