【问题标题】:jquery image hover on tabletjquery图像悬停在平板电脑上
【发布时间】:2015-04-08 08:10:58
【问题描述】:

我正在尝试在平板电脑上使用的网站上加入悬停图像旋转功能。不幸的是,我对如何解决最后一块拼图有点迷茫。有谁能帮忙吗?下面的脚本在悬停时旋转图像并添加一个额外的文本框。

jquery:
$(document).ready(function(){
  $(".1").hover(
function(){$("#Information-Seawater").show();},
function(){$("#Information-Seawater").hide()});

});

jQuery(function(){
     $(".1").hover(
          function(){this.src = this.src.replace("-Icon","-Image");},
          function(){this.src = this.src.replace("-Image","-Icon");
     });
});

风格:

#Information-Seawater {
    display: none;
      top: 650px;
      margin-left:auto;
    margin-right:auto;
    width:60%; 
    font-family: Consolas;
    background: #00bbe4;
    border: 2px solid black;
    COLOR: #006080; 
  }

html:

<td class="style6" style="height: 77px; width: 140px"><a href="Http://"><img `id="1" height="147" src="website-%20images/Seawater-Icon.jpg" alt="" class="1" width="140"></a></td>`

<div id="Information-Seawater">
<span class="Information-Header">text<br /></span>
text
<br />
</div>

上述脚本在个人电脑上运行良好,但在平板电脑上却不行。我希望有人能够帮助我将上面的功能与下面的功能结合起来,在平板电脑上,需要在悬停之前单击一次图像。

http://jsfiddle.net/c_kick/s9rB4/

Jquery hover function and click through on tablet

感谢任何帮助!

【问题讨论】:

    标签: jquery mouseover


    【解决方案1】:

    您不能将鼠标悬停在平板电脑上,因为在您触摸屏幕之前不会发生任何事件,此时它就是一次点击。尝试检测它何时是平板电脑并绑定点击事件而不是悬停。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-22
      • 1970-01-01
      • 1970-01-01
      • 2015-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-01
      相关资源
      最近更新 更多