2017-05-29 73 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 –