onmouseover事件不适用于移动设备

时间:2015-10-04 19:32:04

标签: css html5 twitter-bootstrap mouseevent onmouseover

我正在网站http://zag-test.nowcommu.myhostpoint.ch/website/intime2.html上工作,您可以看到右侧有响应式图片地图。

我需要的是在移动设备上为该图片启用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>

3 个答案:

答案 0 :(得分:1)

在移动设备上不存在鼠标悬停事件。

答案 1 :(得分:0)

我不知道您点击它时究竟想要发生什么,但如果不重要,您可以使用javascript将onmouseover转换为onclick,或者只需转动{ {1}}进入

onclick="http://zag-test.nowcommu.myhostpoint.ch/website/1.png"

答案 2 :(得分:0)

是的,对于移动设备,没有任何名为mouseover的内容。

以下资源可能有助于您了解events

你可以通过互联网找到更多。