2015-10-04 118 views
0

我正在网站http://zag-test.nowcommu.myhostpoint.ch/website/intime2.html上工作,正如您可以看到右侧有一个响应式图像映射。onmouseover事件不适用于手机

我需要的是在手机上启用onmouseover事件。事实上,如果你通过移动设备检查它,你有什么(当你触摸单片)只是一个“页面刷新”。这是HTML代码:

<div class="clock"> 
      <img class="img-responsive" id="Image-Maps-Com-image-maps-2015-10-01-031428" src="http://zag-test.nowcommu.myhostpoint.ch/website/base.png" border="0" width="434" height="420" orgWidth="434" orgHeight="420" usemap="#image-maps-2015-10-01-031428" alt="" /> 
<map name="image-maps-2015-10-01-031428" id="ImageMapsCom-image-maps-2015-10-01-031428"> 
<area shape="rect" coords="432,418,434,420" alt="Image Map" style="outline:none;" title="Image Map" href="http://www.image-maps.com/index.php?aff=mapped_users_60334" /> 
<area alt="" title="" href="" shape="poly" coords="18,295,124,405,167,310,125,258" style="outline:none;" target="_self" onclick="http://zag-test.nowcommu.myhostpoint.ch/website/1.png" onmouseover="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/1.png';" onmouseout="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/base.png';" /> 
<area alt="" title="" href="" shape="poly" coords="21,136,19,286,111,245,120,180" style="outline:none;" target="_self" onclick="http://zag-test.nowcommu.myhostpoint.ch/website/2.png" onmouseover="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/2.png';" onmouseout="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/base.png';" /> 
<area alt="" title="" href="" shape="poly" coords="23,124,135,20,179,124,128,170" style="outline:none;" target="_self" onclick="http://zag-test.nowcommu.myhostpoint.ch/website/3.png" onmouseover="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/3.png';" onmouseout="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/base.png';" /> 
<area alt="" title="" href="" shape="poly" coords="144,17,298,19,256,123,183,123" style="outline:none;" target="_self" onclick="http://zag-test.nowcommu.myhostpoint.ch/website/4.png" onmouseover="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/4.png';" onmouseout="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/base.png';" /> 
<area alt="" title="" href="" shape="poly" coords="306,23,413,136,310,178,261,128" style="outline:none;" target="_self" onclick="http://zag-test.nowcommu.myhostpoint.ch/website/5.png" onmouseover="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/5.png';" onmouseout="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/base.png';" /> 
<area alt="" title="" href="" shape="poly" coords="414,299,416,142,310,182,312,253" style="outline:none;" target="_self" onclick="http://zag-test.nowcommu.myhostpoint.ch/website6.png" onmouseover="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/6.png';" onmouseout="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/base.png';" /> 
<area alt="" title="" href="" shape="poly" coords="296,413,413,305,309,258,255,307" style="outline:none;" target="_self" onclick="http://zag-test.nowcommu.myhostpoint.ch/website/7.png" onmouseover="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/7.png';" onmouseout="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/base.png';" /> 
</map> 
    <p style=" margin-top: 20px; color: #000;" align="left">Ablauf eines Störfalls in einer Käserei –<br>Wir sind “in Time”.</p> 
</div> 

回答

1

在移动设备上不存在mouseover事件。

+0

我知道我必须使用ontouch。但我找不到一个好的指南或教程 – Antonioz

0

我不知道你想,当你点击它,会发生什么,但如果它并不重要,你可以使用JavaScript来把onmouseoveronclick,或者只是把onclick="http://zag-test.nowcommu.myhostpoint.ch/website/1.png"

onclick="if(document.images) document.getElementById('Image-Maps-Com-image-maps-2015-10-01-031428').src= 'http://zag-test.nowcommu.myhostpoint.ch/website/1.png';"

+0

我需要的是,当你点击第一个区域shape =“rect”coords =“432,418,434,420”http://zag-test.nowcommu.myhostpoint.ch/website /1.png作为工具提示。我的意思是我需要和你一样的效果,如果你在桌面上检查网站。 – Antonioz

+0

因此,如果在非移动设备上单击它时确实会出现这种情况,那么您可以在onclick之后使用与onmouseover之后相同的scrypt,以便移动用户只需点击“时间形状”即可查看发生了什么 – loelu

相关问题