jquery确定2个div之间的重叠量
我有两个相互重叠的 div(矩形)。如何确定 JavaScript 中两个 div 之间的交叉/重叠量?
我意识到我会得到每个矩形的尺寸:
offset.top、offset.left、elt.offsetWidth、elt.offsetHeight
但从那里我不确定如何确定重叠量。
I have two divs (rectangles) that overlap each other. How do I determine the amount of intersection/overlap between the two divs in javascript?
I realize I'll get the dimensions for each rectangle:
offset.top, offset.left, elt.offsetWidth, elt.offsetHeight
But from there I'm unsure how to determine the amount of overlap.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)