【发布时间】:2021-09-23 08:26:05
【问题描述】:
我有一张图片地图。我想在图像地图中悬停一个区域时显示图像。但有可能吗?我的意思是即使我在悬停时显示图像,我希望图像映射在我单击它并指向另一个页面时继续工作。
这是图像映射的示例: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_images_map2
<!DOCTYPE html>
<html>
<body>
<h2>Image Maps</h2>
<p>Click on the computer, the phone, or the cup of coffee to go to a new page and read more about the topic:</p>
<img src="workplace.jpg" alt="Workplace" usemap="#workmap" width="400" height="379">
<map name="workmap">
<area shape="rect" coords="34,44,270,350" alt="Computer" href="computer.htm">
<area shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm">
<area shape="circle" coords="337,300,44" alt="Cup of coffee" href="coffee.htm">
</map>
</body>
</html>
【问题讨论】:
-
我相信这是可能的,但问题是,您尝试过什么?悬停时还希望图像显示在哪里?
-
例如,当我将电脑悬停时,我想显示一张图片(例如:images.unsplash.com/…" width="200" class="hover-img" />)
标签: javascript html jquery css imagemap