作者:穷朱朱 | 来源:互联网 | 2023-05-17 20:49
I can get an object if it's moused over. I can get the coordinates of the mouse at any given time. How do I get an object given it's coordinates - if they are different from the mouse?
我可以得到一个物体,如果它被碾过。我可以在任何给定的时间获得鼠标的坐标。如何给出一个给定坐标的对象 - 如果它们与鼠标不同的话?
Essentially the user is dropping a div on a certain place on the screen. Since the div is wider than the mouse cursor, I need to know what object the corner of the div is over (not what the mouse is over). Is there a way to raise a mousemove event in JS - passing it the coordinates?
Thanks
用户基本上是在屏幕上的某个位置放弃div。由于div比鼠标光标宽,我需要知道div的角落是什么对象(而不是鼠标的结束)。有没有办法在JS中引发mousemove事件 - 传递坐标?谢谢
Just a quick post script for others who read this post. Although I did not choose the jquery for my answer, it may be the answer for you. This appears to be a very flexible feature rich solution for many of the client side tools we want to offer.
阅读这篇文章的其他人只需一个快速的帖子脚本。虽然我没有选择jquery作为我的答案,但它可能是你的答案。对于我们想要提供的许多客户端工具,这似乎是一个非常灵活的功能丰富的解决方案。
3 个解决方案