我有一个如下所示的 div,

鉴于我使用 getBoundingClientRect() 方法具有顶部、左侧、底部、右侧、x、y 值,我如何获得该 div 的图像中的 (x1,y1) 和 (x2, y2) 坐标。
我尝试过类似下面的方法,
for x1, y1
return {x: (rect.left + rect.width / 2), y: rect.top + (rect.height / 2)};
for x2, y2
return {x: rect.right, y:rect.top + (rect.height / 2)};
有人可以帮我解决这个问题。谢谢。
翻过高山走不出你
蛊毒传说
随时随地看视频慕课网APP
相关分类