在 javascript 中向 div 元素添加标记
我需要一个行为类似于向地图添加标记的标记。双击时,会在单击的点处显示标记,并返回单击的点的 x/y 像素坐标。
我希望能够将这些标记添加到已经用 javascript 绘制地图的 div 元素 () 中。
非常感谢这里的任何帮助!
I need a marker that behaves much like adding a marker to a map. On double click cause a marker to be displayed at the point that was clicked, and returns the x/y pixel coordinates of the point that was clicked.
I want to be able to add those markers into div element (<div id="paper"></div>
) that has got map drawn in javascript already.
Any help here is much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
jquery.com 上有一个教程专门针对这个问题。
http://docs.jquery.com/Tutorials:Mouse_Position
There's a tutorial on jquery.com for exactly that question.
http://docs.jquery.com/Tutorials:Mouse_Position
在伪代码中
In pseudocode