2017-05-29 96 views
-1

当我点击图像坐标提醒消息显示。图像坐标链接点击提醒消息显示

例如:这是我的照片 enter image description here

如果我点击cycle seat显示alert“你点击周期座”

<img src="https://www.bricklanebikes.co.uk/content/images/thumbs/0021232_6ku-fixie-single-speed-bike-beach-bum_1200.jpeg" alt="" usemap="#Map" /> 
<map name="Map" id="Map"> 
    <area alt="" title="Cycle Seat" href="cycle-seat.html" shape="poly" coords="329,146,364,162,394,171,442,164,490,168,520,171,506,154,479,146,373,139,347,132,336,132,331,141,330,138" /> 

活生生的例子:https://jsfiddle.net/qwzh4vgh/

+0

你的问题是什么?什么不起作用? – Xufox

+0

上午创建一个坐标使用thhis链接http://imagemap-generator.dariodomi.de/ –

+0

当我点击循环座位显示一些警报@Xufox –

回答

2

如果我正确地理解了你,你想展示一些当您点击图像地图内的区域时,会弹出警告框。 Here is a question它可以帮助你做到这一点。使用jQuery

示例代码:

$("map#Map area").on('click', function (e) { e.preventDefault(); alert($(this).attr('title')); });

在这里被更新jsfiddle

+0

谢谢你你的回答@Stanislav Kvitash –