2015-10-04 127 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