简体   繁体   English

为什么定位标记仅在图像底部起作用?

[英]Why is the anchor tag only working on the bottom of the image?

I'm having difficulty turning an image into a clickable link. 我很难将图片转换为可点击的链接。 The image is a chart that's generated by a 3rd party service that we use. 该图像是由我们使用的第三方服务生成的图表。 The functional image can be seen here: 功能图可以在这里看到:

http://jsfiddle.net/3jMdW/ (please note that I've hosted the image on imgur because otherwise you won't be able to see it.) http://jsfiddle.net/3jMdW/ (请注意,我已经将图像托管在imgur上,因为否则您将无法看到它。)

The problem I'm having is that the link only seems to work along the bottom edge of the image in Firefox. 我遇到的问题是该链接似乎只能在Firefox中图像的底部边缘工作。 If I click anywhere in the middle of the image, the link doesn't work (even though the hand icon is visible). 如果单击图像中间的任何位置,则该链接将不起作用(即使手形图标可见)。 How can I fix this so that clicking anywhere in the image activates the link request. 如何解决此问题,以便单击图像中的任意位置可以激活链接请求。

Just to note, there is a lot of extra HTML (scripts/tags) associated with the image. 请注意,还有很多与图像相关的HTML(脚本/标签)。 This is because the charting service maps a chart to its data points for hover-over info. 这是因为制图服务将图表映射到其数据点以获取悬停信息。 The client has asked for this specifically so I can't remove it. 客户已明确要求此内容,因此我无法将其删除。

href属性添加到您的<area>元素。

修改图表模板以删除不属于<img />标记的所有内容,从而解决了此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM