obj.getBoundingClientRect()该方法获得页面中某个元素的左,上,右和下分别相对浏览器视窗(左边,上边)的位置对象(注意是个对象),与浏览器的右边,下边没关系。
js 中的getBoundingClientRect()

如果要得到left,则是obj.getBoundingClientRect().left

 兼容性:ie5 以上 以及 标准浏览器 支持

相关文章:

  • 2022-12-23
  • 2022-03-03
  • 2021-10-02
  • 2021-10-29
猜你喜欢
  • 2021-09-07
  • 2021-05-30
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案