Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题:当我单击任一地址旁边的区域(在 div 中)时,当鼠标光标是默认的而不是指针时,单击时它仍会将用户带到地图上的位置。我怎样才能阻止这种情况,以便仅在用户单击实际地址而不是单击该 div 中的空白区域时将用户带到该地图位置?
您在锚标记中多次调用“myClick(0)”。如果您对放置它们的位置更有选择性,那么您应该能够找到合适的解决方案。如果您只希望地址触发地图,则将其包装如下:
<a href="javascript:myclick(0)">352 Princes Highway Fountain Gate VIC 3805</a>
并删除对您不需要的任何其他 myClick(0) 的调用。