gpt4 book ai didi

javascript - jQuery maphilight 不工作

转载 作者:行者123 更新时间:2023-11-28 04:25:11 26 4
gpt4 key购买 nike

我错过了什么?我正在使用 David Lynch maphilight 插件并一直在将我的代码与此页面进行比较以进行故障排除,但两天后,我仍然遇到问题。当我将鼠标悬停在(甚至单击)映射图像的任何部分上时,颜色不会显示。这些链接按预期工作。

我的脚本调用是:

   <head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript" src="jquery.maphilight.js"></script>
<script type="text/javascript">$(function() {
$('.AMGCmap1').maphilight();
</script>
</head>

img 和 map 代码是:

            <div>
<img class ="map" id ="AMGCmap1" src="Images\AMGC Logo Big.png" alt="AMGC Logo" usemap="#AGMCmap" border="15">

<map name="AGMCmap">
<area shape="poly" coords="61,432, 58,346, 71,285, 148,287, 164,345, 166,432" href="news.html" title= "News" data-maphilight='{"strokeColor":"0000ff","strokeWidth":5,"fillColor":"ff0000","fillOpacity":0.6}' >
</map>

</div>

我尝试在函数中使用 img ID 和“'.map'”,但没有发现任何区别。还有其他人遇到这样的问题吗?

我目前正在使用 Chrome,如果有帮助的话。

最佳答案

<img class ="map" id ="AMGCmap1" ...>

这里你有一个id,同时你在你的脚本中调用一个类。

$('.AMGCmap1').maphilight();

这可能是问题所在。将 HTML 中的 id 编辑为一个类:

<img class ="map AMGCmap1" ...>

或者在你的脚本中调用一个id:

$('#AMGCmap1').maphilight();

无论如何,即使我非常仔细地检查了我的脚本,我也遇到了同样的问题,让我知道你是否可以在这个修复后让它工作。

关于javascript - jQuery maphilight 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42006776/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com