HTML/JavaScript:图像地图的鼠标悬停效果?
我正在尝试通过创建一个非营利组织的网站来帮助他们。他们希望(呃)他们的徽标能够用作 HTML 图像映射。换句话说,当您单击徽标的不同部分时,您将被定向到不同的网页。然而,他们也想要鼠标悬停效果:当您将鼠标悬停在图像映射的特定部分时,该图形应该突出显示。
如果徽标很简单,我会将其切成矩形,并将鼠标悬停和单击事件附加到适当的矩形。然而,由于其徽标的复杂性,这是不可能的。
有人在没有 Flash 的情况下做过类似的事情吗?我不是 Flash 开发人员,但这在 HTML/JavaScript 中看起来是一项非常困难的任务。
有什么想法吗?谢谢!
I'm trying to help out a nonprofit by doing their website. They want (ugh) their logo to serve as an HTML image map. In other words, when you click on different parts of the logo, you're directed to different web pages. They also, however, want mouseover effects: when you mouseover a particular portion of the image map, that piece of the graphic should be highlighted.
If the logo was simple, I would slice it up into rectangles and attach mouseover and click events to the appropriate rectangles. With the complexity of their logo, this is not possible, however.
Has anyone done anything like this without Flash? I'm not a Flash developer but this is looking like a very difficult task in just HTML/JavaScript.
Any ideas? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要处理
标记的鼠标悬停事件。
You need to handle the mouseover event of the
<area>
tag.查看 HTML 地图标签 - http://www.w3schools.com/TAGS/tag_map .asp。它允许更多自定义形状。
一些资源:
Have a look at the HTML map tag - http://www.w3schools.com/TAGS/tag_map.asp. It allows for more custom shapes.
Some resources:
尝试此资源:
Try out this resource to: