function getPosition(target) {
  var left = 0, top = 0;

  do {
  left += target.offsetLeft || 0;
  top += target.offsetTop || 0;
  target = target.offsetParent;
  } while(target);
  return {
  left: left,
  top: top
  };
}

相关文章:

  • 2022-02-25
  • 2021-11-28
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2021-04-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-06
  • 2022-02-20
  • 2022-01-19
  • 2022-12-23
  • 2021-10-28
相关资源
相似解决方案