【问题标题】:Trying to highlight image map areas while beeing responsive尝试在响应时突出显示图像地图区域
【发布时间】:2015-10-20 20:38:48
【问题描述】:

我设法修复了它,但我必须在响应式或悬停时突出显示区域地图之间做出选择。 Thiw 是代码,如果我 SET class="map" 然后我得到悬停效果并失去响应!!!有什么想法吗?

<p>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js" type="text/javascript"></script>
<script src="templates/it_zen/assets/js/jquery.maphilight.js" type="text/javascript"></script>
<script type="text/javascript">// <![CDATA[
$(function() {
        $('.map').maphilight();
});
// ]]></script>
<script src="templates/it_zen/assets/js/imageMapResizer.min.js" type="text/javascript"></script>
</p>
<hr />
<h3 style="text-align: center;">All the EY+ routes</h3>
<hr />
<h5 style="text-align: center;"> Start exploring by clicking on each frame</h5>
<div>
<div>
<p><img class="" /*if set class="map" i loose responsive */ src="images/Maps/xartis_genikos.png" alt="" usemap="#map" width="2995" height="2264" border="0" /> <map name="map"> <!-- #$-:Image map file created by GIMP Image Map plug-in --> <!-- #$-:GIMP Image Map plug-in by Maurits Rijk --> <!-- #$-:Please do not edit lines starting with "#$" --> <!-- #$VERSION:2.3 --> <!-- #$AUTHOR:user --> 
<area coords="184,107,1241,1260" shape="rect" href="ey-routes/epirus-paxus" />
 
<area coords="911,1171,1540,1811" shape="rect" href="ey-routes/east-ionian" />
 
<area coords="525,941,1581,2097" shape="rect" href="ey-routes/kefalonia-ithaca" />
 
<area coords="2039,1453,2919,2107" shape="rect" href="ey-routes/korinthian-gulf" />
 </map>
<script>// <![CDATA[
imageMapResize();
// ]]></script>
</p>
</div>
</div>

【问题讨论】:

  • Java与javascript无关。
  • 请发布您在问题本身中使用的代码。不要依赖外部链接。

标签: javascript joomla imagemap


【解决方案1】:

在Joomla模板中插入Java Script文件的正确方法是:

$doc->addScript($tpath.'https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js'); // if necessary
$doc->addScript($tpath.'/js/jquery.maphilight.js');

根据我的阅读,这段代码照亮了地图,但没有使其响应。

尝试更改 $ 符号和单词 jQuery 之间的函数调用

【讨论】:

  • 它肯定反应灵敏(我检查了各种设备和屏幕),但它不亮。我安装在 template/assets/js/ 文件夹中的“jquery.maphilight.js”可能有问题。也许我可以在里面写整个脚本而不是调用它,你怎么看?这怎么写?把jquery.maphilight.js里面的所有代码都复制过来粘贴到文章的jce编辑器里面?
  • 重新检查问题,我更改了代码但有问题
猜你喜欢
  • 1970-01-01
  • 2019-09-25
  • 2011-01-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-08-21
  • 2013-11-26
相关资源
最近更新 更多