function offsetTL(obj){//获取到body的offsetTop和offsetLeft
var t=0,l=0;
while(obj){
t=t+obj.offsetTop;
l=l+obj.offsetLeft;
obj=obj.offsetParent;
}
return {top:t,left:l};
}

相关文章:

  • 2021-07-14
  • 2021-09-17
  • 2021-12-19
  • 2021-12-15
  • 2022-12-23
  • 2021-11-30
  • 2021-07-25
猜你喜欢
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案