理解:getBoundingClientRect用于获取某个元素相对于视窗的位置集合。集合中有top, right, bottom, left等属性。
getBoundingClientRect().top:元素上边到视窗上边的距离;
getBoundingClientRect().right:元素右边到视窗左边的距离;
getBoundingClientRect().bottom:元素下边到视窗上边的距离;
getBoundingClientRect().left:元素左边到视窗左边的距离;

网友评论