我已经编写了使图像中的多边形可点击的代码,但是它不起作用。
这是我的代码:
$needle = "http://www.sohgoh-outline.jp/";
foreach ($link as $unset){
if (($index = strpos($unset, $needle)) !== false){
$renai [] = $unset[$index];
unset($unset[$index]);
}
}
答案 0 :(得分:1)
如果将其清除,该代码将正常工作。您在哪里使用了错误的引号。
HTML 使用"
"
(双引号)
排版使用“
”
(双引号引起来)
<img src="https://i.imgur.com/YWNyGHD.png" width="538" height="480" usemap="#mymap" />
<map name="mymap">
<area shape="poly" coords="370, 66, 395, 72, 406, 74, 414, 76, 425, 89, 441, 106, 461, 105, 462, 117, 460, 124, 465, 138, 461, 152, 449, 168, 453, 174, 444, 182, 425, 183, 419, 176, 397, 181, 397, 196, 401, 202, 384, 224, 374, 214, 368, 196, 356, 196, 373, 156, 360, 148, 334, 156, 350, 145, 356, 133, 347, 125, 346, 103, 355, 93, 385, 103, 380, 90, 385, 79 379, 72, 369, 73" href="https://en.wikipedia.org/wiki/Greater_Khorasan" title="khorasan">
</map>
答案 1 :(得分:0)
使用双引号而不是大括号
测试通过后,可以随时删除您的问题:
<img src="https://i.imgur.com/YWNyGHD.png" usemap="#mymap" />
<map name="mymap">
<area shape = "poly" coords = "370, 66, 395, 72, 406, 74, 414, 76, 425,
89, 441, 106, 461, 105, 462, 117, 460, 124, 465, 138, 461, 152, 449,
168, 453, 174, 444, 182, 425, 183, 419, 176, 397, 181, 397, 196, 401,
202, 384, 224, 374, 214, 368, 196, 356, 196, 373, 156, 360, 148, 334,
156, 350, 145, 356, 133, 347, 125, 346, 103, 355, 93, 385, 103, 380,
90, 385, 79 379, 72, 369, 73, 370, 66" href = "#" title = "khorasan"/>
</map>