Screen Coordinates of a element, via Javascript

后端 未结 3 1493
悲&欢浪女
悲&欢浪女 2020-12-01 07:47

I\'m trying to get the screen coordinates (that is, relative to the top left corner of the screen) of an element in a browser window. It\'s easy to get the size and position

3条回答
  •  离开以前
    2020-12-01 08:27

    I disagree with jvenema's answer.

    I have found a solution that is working for me on google chrome anyway, but I hope that this will works on many other browsers too (maybe not on some old internet explorers).

    Inside the

    Hope that helps!

提交回复
热议问题